Changeset 24936 in vbox
- Timestamp:
- Nov 25, 2009 10:57:32 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/MachineImpl.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r24919 r24936 7367 7367 NULL); 7368 7368 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. */ 7369 7373 // at this point, the old image is still locked for writing, but instead 7370 7374 // we need the new diff image locked for writing and lock the previously … … 7442 7446 7443 7447 AutoWriteLock alock(this); 7448 LogFlowThisFuncEnter(); 7444 7449 7445 7450 AssertReturn(mMediaData.isBackedUp(), E_FAIL); … … 7463 7468 { 7464 7469 /* deassociate and mark for deletion */ 7470 LogFlowThisFunc(("Detaching '%s', pending deletion\n", (*it)->logName())); 7465 7471 rc = hd->detachFrom(mData->mUuid); 7466 7472 AssertComRC(rc); … … 7473 7479 { 7474 7480 /* no: de-associate */ 7481 LogFlowThisFunc(("Detaching '%s', no deletion\n", (*it)->logName())); 7475 7482 rc = hd->detachFrom(mData->mUuid); 7476 7483 AssertComRC(rc); 7477 7484 continue; 7478 7485 } 7486 LogFlowThisFunc(("Not detaching '%s'\n", (*it)->logName())); 7479 7487 } 7480 7488 … … 7504 7512 ++it) 7505 7513 { 7514 LogFlowThisFunc(("Deleting '%s'\n", (*it)->logName())); 7506 7515 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; 7508 7528 } 7509 7529
Note:
See TracChangeset
for help on using the changeset viewer.

