VirtualBox

Changeset 15163 in vbox


Ignore:
Timestamp:
Dec 9, 2008 1:08:49 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40570
Message:

Main: #3312: De-associate the implicit hard disk from the VM before its deletion on failure (to create snapshot, revert to current snapshot, etc). Fixes the problem of orphan diffs after falied operations.

File:
1 edited

Legend:

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

    r15158 r15163  
    69116911        if ((*it)->isImplicit())
    69126912        {
     6913            /* deassociate and mark for deletion */
     6914            rc = hd->detachFrom (mData->mUuid);
     6915            AssertComRC (rc);
    69136916            implicitAtts.push_back (*it);
    69146917            continue;
     
    69246927            rc = hd->detachFrom (mData->mUuid);
    69256928            AssertComRC (rc);
     6929            continue;
    69266930        }
    69276931    }
     
    69296933    /* rollback hard disk changes */
    69306934    mHDData.rollback();
     6935
     6936    MultiResult mrc (S_OK);
    69316937
    69326938    /* delete unused implicit diffs */
     
    69516957            ComObjPtr <HardDisk2> hd = (*it)->hardDisk();
    69526958
    6953             rc = hd->deleteStorageAndWait();
    6954 
    6955             /// @todo NEWMEDIA report the error as a warning here. Note that
    6956             /// we cannot simply abort the rollback because parts of machine
    6957             /// data may have been already restored from backup and
    6958             /// overwrote the recent changes. The best we can do is to
    6959             /// deassociate the hard disk (to prevent the consistency) but
    6960             /// leave it undeleted.
    6961 
    6962             if (FAILED (rc))
    6963             {
    6964                 rc = hd->detachFrom (mData->mUuid);
    6965                 AssertComRC (rc);
    6966             }
     6959            mrc = hd->deleteStorageAndWait();
    69676960        }
    69686961
     
    69756968    }
    69766969
    6977     return rc;
     6970    return mrc;
    69786971}
    69796972
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