VirtualBox

Changeset 37698 in vbox for trunk


Ignore:
Timestamp:
Jun 29, 2011 7:21:50 PM (13 years ago)
Author:
vboxsync
Message:

Main/Console: don't unmount the drive on eject if this is a host drive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r37687 r37698  
    95339533        if (!pMediumAtt.isNull())
    95349534        {
    9535             alock.release();
    9536 
    9537             ComPtr<IMediumAttachment> pNewMediumAtt;
    9538             HRESULT rc = pData->pConsole->mControl->EjectMedium(pMediumAtt, pNewMediumAtt.asOutParam());
    9539             if (SUCCEEDED(rc))
    9540                 fireMediumChangedEvent(pData->pConsole->mEventSource, pNewMediumAtt);
    9541 
    9542             alock.acquire();
    9543             if (pNewMediumAtt != pMediumAtt)
     9535            IMedium *pMedium;
     9536            HRESULT rc = pMediumAtt->COMGETTER(Medium)(&pMedium);
     9537            AssertComRC(rc);
     9538            BOOL fHostDrive = FALSE;
     9539            rc = pMedium->COMGETTER(HostDrive)(&fHostDrive);
     9540            AssertComRC(rc);
     9541            if (!fHostDrive)
    95449542            {
    9545                 pData->pmapMediumAttachments->erase(devicePath);
    9546                 pData->pmapMediumAttachments->insert(std::make_pair(devicePath, pNewMediumAtt));
     9543                alock.release();
     9544
     9545                ComPtr<IMediumAttachment> pNewMediumAtt;
     9546                rc = pData->pConsole->mControl->EjectMedium(pMediumAtt, pNewMediumAtt.asOutParam());
     9547                if (SUCCEEDED(rc))
     9548                    fireMediumChangedEvent(pData->pConsole->mEventSource, pNewMediumAtt);
     9549
     9550                alock.acquire();
     9551                if (pNewMediumAtt != pMediumAtt)
     9552                {
     9553                    pData->pmapMediumAttachments->erase(devicePath);
     9554                    pData->pmapMediumAttachments->insert(std::make_pair(devicePath, pNewMediumAtt));
     9555                }
    95479556            }
    95489557        }
Note: See TracChangeset for help on using the changeset viewer.

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