VirtualBox

Changeset 55835 in vbox for trunk


Ignore:
Timestamp:
May 12, 2015 6:37:34 PM (10 years ago)
Author:
vboxsync
Message:

Main/Machine: repair VM configs a bit more thoroughly, as otherwise it can lead to inconsistencies (repair gets lost) when the config was repaired and then immediately a new offline snapshot is taken

File:
1 edited

Legend:

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

    r55833 r55835  
    90689068
    90699069#ifdef VBOX_WITH_GUEST_PROPS
     9070        /* Guest properties (optional) */
     9071
    90709072        /* Only load transient guest properties for configs which have saved
    90719073         * state, because there shouldn't be any for powered off VMs. The same
     
    90749076         * Note: can't rely on the machine state, as it isn't set yet. */
    90759077        bool fSkipTransientGuestProperties = mSSData->strStateFilePath.isEmpty();
    9076         /* Guest properties (optional) */
    9077         for (settings::GuestPropertiesList::const_iterator it = data.llGuestProperties.begin();
    9078             it != data.llGuestProperties.end();
    9079             ++it)
     9078        /* apologies for the hacky unconst() usage, but this needs hacking
     9079         * actually inconsistent settings into consistency, otherwise there
     9080         * will be some corner cases where the inconsistency survives
     9081         * surprisingly long without getting fixed, especially for snapshots
     9082         * as there are no config changes. */
     9083        settings::GuestPropertiesList &llGuestProperties = unconst(data.llGuestProperties);
     9084        for (settings::GuestPropertiesList::iterator it = llGuestProperties.begin();
     9085            it != llGuestProperties.end();
     9086            /*nothing*/)
    90809087        {
    90819088            const settings::GuestProperty &prop = *it;
     
    90859092                && (   fFlags & guestProp::TRANSIENT
    90869093                    || fFlags & guestProp::TRANSRESET))
     9094            {
     9095                it = llGuestProperties.erase(it);
    90879096                continue;
     9097            }
    90889098            HWData::GuestProperty property = { prop.strValue, (LONG64) prop.timestamp, fFlags };
    90899099            mHWData->mGuestProperties[prop.strName] = property;
     9100            ++it;
    90909101        }
    90919102
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