VirtualBox

Changeset 24936 in vbox


Ignore:
Timestamp:
Nov 25, 2009 10:57:32 AM (15 years ago)
Author:
vboxsync
Message:

MachineImpl.cpp: Hacked around the locking cleanup issue in deleteImplicitDiff because it's driving me nuts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r24919 r24936  
    73677367                                                  NULL);
    73687368
     7369            /** @todo r=bird: How is the locking and diff image cleaned up if we fail before
     7370             *        the push_back?  Looks like we're going to leave medium with the
     7371             *        wrong kind of lock (general issue with if we fail anywhere at all)
     7372             *        and an orphaned VDI in the snapshots folder. */
    73697373            // at this point, the old image is still locked for writing, but instead
    73707374            // we need the new diff image locked for writing and lock the previously
     
    74427446
    74437447    AutoWriteLock alock(this);
     7448    LogFlowThisFuncEnter();
    74447449
    74457450    AssertReturn(mMediaData.isBackedUp(), E_FAIL);
     
    74637468        {
    74647469            /* deassociate and mark for deletion */
     7470            LogFlowThisFunc(("Detaching '%s', pending deletion\n", (*it)->logName()));
    74657471            rc = hd->detachFrom(mData->mUuid);
    74667472            AssertComRC(rc);
     
    74737479        {
    74747480            /* no: de-associate */
     7481            LogFlowThisFunc(("Detaching '%s', no deletion\n", (*it)->logName()));
    74757482            rc = hd->detachFrom(mData->mUuid);
    74767483            AssertComRC(rc);
    74777484            continue;
    74787485        }
     7486        LogFlowThisFunc(("Not detaching '%s'\n", (*it)->logName()));
    74797487    }
    74807488
     
    75047512             ++it)
    75057513        {
     7514            LogFlowThisFunc(("Deleting '%s'\n", (*it)->logName()));
    75067515            ComObjPtr<Medium> hd = (*it)->medium();
    7507             mrc = hd->deleteStorageAndWait();
     7516
     7517            rc = hd->deleteStorageAndWait();
     7518#if 1 /* HACK ALERT: Just make it kind of work */ /** @todo Fix this hack properly. The LockWrite / UnlockWrite / LockRead changes aren't undone! */
     7519            if (rc == VBOX_E_INVALID_OBJECT_STATE)
     7520            {
     7521                LogFlowFunc(("Applying unlock hack on '%s'! FIXME!\n", (*it)->logName()));
     7522                hd->UnlockWrite(NULL);
     7523                rc = hd->deleteStorageAndWait();
     7524            }
     7525#endif
     7526            AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, (*it)->logName(), hd->locationFull().c_str() ));
     7527            mrc = rc;
    75087528        }
    75097529
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