VirtualBox

Changeset 27644 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 23, 2010 4:07:49 PM (15 years ago)
Author:
vboxsync
Message:

Main: fix missing machine settings save in some takeSnapshot() situations (recent trunk regression)

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r27610 r27644  
    72537253 *    #isReallyModified() returns false. This is necessary for cases when we
    72547254 *    change machine data directly, not through the backup()/commit() mechanism.
     7255 *  - SaveS_Force: settings will be saved without doing a deep compare of the
     7256 *    settings structures. This is used when this is called because snapshots
     7257 *    have changed to avoid the overhead of the deep compare.
    72557258 *
    72567259 * @note Must be called from under this object's write lock. Locks children for
     
    73557358        if (aFlags & SaveS_ResetCurStateModified)
    73567359        {
    7357             // this gets set by restoreSnapshot()
     7360            // this gets set by takeSnapshot() (if offline snapshot) and restoreSnapshot()
    73587361            mData->mCurrentStateModified = FALSE;
     7362            fNeedsWrite = true;     // always, no need to compare
     7363        }
     7364        else if (aFlags & SaveS_Force)
     7365        {
    73597366            fNeedsWrite = true;     // always, no need to compare
    73607367        }
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r27607 r27644  
    14561456            mData->mFirstSnapshot = mData->mCurrentSnapshot;
    14571457
     1458        int flSaveSettings = SaveS_Force;       // do not do a deep compare in machine settings,
     1459                                                // snapshots change, so we know we need to save
    14581460        if (!fOnline)
    14591461            /* the machine was powered off or saved when taking a snapshot, so
    14601462             * reset the mCurrentStateModified flag */
    1461             mData->mCurrentStateModified = FALSE;
    1462 
    1463         rc = saveSettings(NULL);
     1463            flSaveSettings |= SaveS_ResetCurStateModified;
     1464
     1465        rc = saveSettings(NULL, flSaveSettings);
    14641466                // no need to change for whether VirtualBox.xml needs saving since
    14651467                // we'll save the global settings below anyway
  • trunk/src/VBox/Main/include/MachineImpl.h

    r27607 r27644  
    725725        SaveS_ResetCurStateModified = 0x01,
    726726        SaveS_InformCallbacksAnyway = 0x02,
    727         /* flags for #saveSnapshotSettings() */
    728         SaveSS_CurStateModified = 0x40,
    729         SaveSS_CurrentId = 0x80,
     727        SaveS_Force = 0x04,
    730728        /* flags for #saveStateSettings() */
    731729        SaveSTS_CurStateModified = 0x20,
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