VirtualBox

Ignore:
Timestamp:
Mar 26, 2010 9:48:25 PM (15 years ago)
Author:
vboxsync
Message:

Main: fixed saving guest properties at machine power off

File:
1 edited

Legend:

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

    r27730 r27761  
    184184    mSyntheticCpu = false;
    185185    mPropertyServiceActive = false;
     186    mGuestPropertiesModified = false;
    186187    mHpetEnabled = false;
    187188
     
    76637664            HWData::GuestProperty property = *it;
    76647665
     7666            /* Remove transient guest properties at shutdown unless we
     7667             * are saving state */
     7668            if (   (   mData->mMachineState == MachineState_PoweredOff
     7669                    || mData->mMachineState == MachineState_Aborted
     7670                    || mData->mMachineState == MachineState_Teleported)
     7671                && property.mFlags & guestProp::TRANSIENT)
     7672                continue;
    76657673            settings::GuestProperty prop;
    76667674            prop.strName = property.strName;
     
    76757683
    76767684        data.strNotificationPatterns = mHWData->mGuestPropertyNotificationPatterns;
     7685        /* I presume this doesn't require a backup(). */
     7686        mHWData->mGuestPropertiesModified = false;
    76777687#endif /* VBOX_WITH_GUEST_PROPS defined */
    76787688    }
     
    99639973            {
    99649974                mHWData->mGuestProperties.erase(iter);
     9975                mHWData->mGuestPropertiesModified = true;
    99659976                break;
    99669977            }
     
    99699980            HWData::GuestProperty property = { aName, aValue, aTimestamp, fFlags };
    99709981            mHWData->mGuestProperties.push_back(property);
     9982            mHWData->mGuestPropertiesModified = true;
    99719983        }
    99729984
     
    1079310805    }
    1079410806
     10807    if (   aMachineState == MachineState_PoweredOff
     10808        || aMachineState == MachineState_Aborted
     10809        || aMachineState == MachineState_Teleported)
     10810    {
     10811        /* Make sure any transient guest properties get removed from the
     10812         * property store on shutdown. */
     10813       
     10814        HWData::GuestPropertyList::iterator it;
     10815        BOOL fNeedsSaving = mHWData->mGuestPropertiesModified;
     10816        if (!fNeedsSaving)
     10817            for (it = mHWData->mGuestProperties.begin();
     10818                 it != mHWData->mGuestProperties.end(); ++it)
     10819                if (it->mFlags & guestProp::TRANSIENT)
     10820                {
     10821                    fNeedsSaving = true;
     10822                    break;
     10823                }
     10824        if (fNeedsSaving)
     10825        {
     10826            mData->mCurrentStateModified = TRUE;
     10827            stsFlags |= SaveSTS_CurStateModified;
     10828            SaveSettings();
     10829        }
     10830    }
     10831
    1079510832    rc = saveStateSettings(stsFlags);
    1079610833
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