VirtualBox

Ignore:
Timestamp:
Jul 4, 2012 9:19:44 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78900
Message:

Main/Machine: All attached devices will be detached automatically when a storage controller is removed from VM. Now this logic concentrated in the one place - function STDMETHODIMP Machine::RemoveStorageController.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r41347 r42017  
    10131013    if (fRemoveCtl)
    10141014    {
    1015         com::SafeIfaceArray<IMediumAttachment> mediumAttachments;
    1016 
    1017         CHECK_ERROR(machine,
    1018                      GetMediumAttachmentsOfController(Bstr(pszCtl).raw(),
    1019                                                       ComSafeArrayAsOutParam(mediumAttachments)));
    1020         for (size_t i = 0; i < mediumAttachments.size(); ++ i)
    1021         {
    1022             ComPtr<IMediumAttachment> mediumAttach = mediumAttachments[i];
    1023             LONG port = 0;
    1024             LONG device = 0;
    1025 
    1026             CHECK_ERROR(mediumAttach, COMGETTER(Port)(&port));
    1027             CHECK_ERROR(mediumAttach, COMGETTER(Device)(&device));
    1028             CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl).raw(), port, device));
    1029         }
    1030 
    1031         if (SUCCEEDED(rc))
    1032             CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl).raw()));
    1033         else
    1034             errorArgument("Can't detach the devices connected to '%s' Controller\n"
    1035                           "and thus its removal failed.", pszCtl);
     1015        CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl).raw()));
    10361016    }
    10371017    else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette