Changeset 24560 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 10, 2009 4:44:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r24539 r24560 2832 2832 Guid id(aId); 2833 2833 ComObjPtr<Medium> medium; 2834 switch (pAttach->type()) 2834 DeviceType_T mediumType = pAttach->type(); 2835 switch (mediumType) 2835 2836 { 2836 2837 case DeviceType_DVD: … … 2901 2902 aDevice); 2902 2903 AutoWriteLock attLock(pAttach); 2904 /* For non-hard disk media, detach straight away. */ 2905 if (mediumType != DeviceType_HardDisk && !oldmedium.isNull()) 2906 oldmedium->detachFrom(mData->mUuid); 2903 2907 if (!medium.isNull()) 2904 2908 medium->attachTo(mData->mUuid); … … 2923 2927 return rc; 2924 2928 AutoWriteLock attLock(pAttach); 2929 /* For non-hard disk media, re-attach straight away. */ 2930 if (mediumType != DeviceType_HardDisk && !oldmedium.isNull()) 2931 oldmedium->attachTo(mData->mUuid); 2925 2932 pAttach->updateMedium(oldmedium, false /* aImplicit */); 2926 2933 } … … 3940 3947 int rc = SSMR3Open(pStateFilePath->raw(), 0 /*fFlags*/, &pSSM); 3941 3948 if (RT_SUCCESS(rc)) 3942 { 3949 { 3943 3950 uint32_t uVersion; 3944 3951 rc = SSMR3Seek(pSSM, "DisplayScreenshot", 1100 /*iInstance*/, &uVersion); … … 7706 7713 { 7707 7714 MediumAttachment *pAttach = *it; 7708 7709 7715 Medium* pMedium = pAttach->medium(); 7710 7716 7711 if (pMedium) 7717 /* Detach only hard disks, since DVD/floppy media is detached 7718 * instantly in MountMedium. */ 7719 if (pAttach->type() == DeviceType_HardDisk && pMedium) 7712 7720 { 7713 7721 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->name().raw())); … … 7745 7753 ++it) 7746 7754 { 7755 MediumAttachment *pAttach = *it; 7756 /* Fix up the backrefs for DVD/floppy media. */ 7757 if (pAttach->type() != DeviceType_HardDisk) 7758 { 7759 Medium* pMedium = pAttach->medium(); 7760 if (pMedium) 7761 { 7762 rc = pMedium->detachFrom(mData->mUuid); 7763 AssertComRC(rc); 7764 } 7765 } 7766 7747 7767 (*it)->rollback(); 7768 7769 pAttach = *it; 7770 /* Fix up the backrefs for DVD/floppy media. */ 7771 if (pAttach->type() != DeviceType_HardDisk) 7772 { 7773 Medium* pMedium = pAttach->medium(); 7774 if (pMedium) 7775 { 7776 rc = pMedium->attachTo(mData->mUuid); 7777 AssertComRC(rc); 7778 } 7779 } 7748 7780 } 7749 7781
Note:
See TracChangeset
for help on using the changeset viewer.