- Timestamp:
- Jul 4, 2012 8:09:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r42000 r42015 5827 5827 if (FAILED(rc)) return rc; 5828 5828 5829 /* We can remove the controller only if there is no device attached. */ 5830 /* check if the device slot is already busy */ 5831 for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin(); 5832 it != mMediaData->mAttachments.end(); 5833 ++it) 5834 { 5835 if ((*it)->getControllerName() == aName) 5836 return setError(VBOX_E_OBJECT_IN_USE, 5837 tr("Storage controller named '%ls' has still devices attached"), 5838 aName); 5829 {/* find all attached devices to the appropriate storage controller and detach them all*/ 5830 MediaData::AttachmentList::const_iterator beginList = mMediaData->mAttachments.begin(); 5831 MediaData::AttachmentList::const_iterator endList = mMediaData->mAttachments.end(); 5832 LONG port = 0; 5833 LONG device = 0; 5834 5835 for (MediaData::AttachmentList::const_iterator it = beginList; 5836 it != endList; 5837 it++) 5838 { 5839 if ((*it)->getControllerName() == aName) 5840 { 5841 port = (*it)->getPort(); 5842 5843 device = (*it)->getDevice(); 5844 5845 rc = DetachDevice(aName, port, device); 5846 if (FAILED(rc)) return rc; 5847 } 5848 } 5839 5849 } 5840 5850
Note:
See TracChangeset
for help on using the changeset viewer.