VirtualBox

Ignore:
Timestamp:
May 7, 2015 12:42:12 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100133
Message:

Main: Allow host-suspend/resume notifiers to be called several times successively.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r55542 r55721  
    62016201        case MachineState_TeleportingPausedVM:
    62026202        case MachineState_OnlineSnapshotting:
    6203 
    6204         /* Remove any keys which are supposed to be removed on a suspend. */
    6205         if (   aReason == Reason_HostSuspend
    6206             || aReason == Reason_HostBatteryLow)
    6207             i_removeSecretKeysOnSuspend();
    6208 
     6203            /* Remove any keys which are supposed to be removed on a suspend. */
     6204            if (   aReason == Reason_HostSuspend
     6205                || aReason == Reason_HostBatteryLow)
     6206            {
     6207                i_removeSecretKeysOnSuspend();
     6208                return S_OK;
     6209            }
    62096210            return setError(VBOX_E_INVALID_VM_STATE, tr("Already paused"));
    62106211
     
    62866287        VMRESUMEREASON enmReason = VMRESUMEREASON_USER;
    62876288        if (aReason == Reason_HostResume)
     6289        {
     6290            /*
     6291             * Host resume may be called multiple times successively. We don't want to VMR3Resume->vmR3Resume->vmR3TrySetState()
     6292             * to assert on us, hence check for the VM state here and bail if it's already in the 'running' state.
     6293             * See @bugref{3495}.
     6294             */
    62886295            enmReason = VMRESUMEREASON_HOST_RESUME;
     6296            if (VMR3GetStateU(ptrVM.rawUVM()) == VMSTATE_RUNNING)
     6297                return S_OK;
     6298        }
    62896299        else if (aReason == Reason_Snapshot)
    62906300            enmReason = VMRESUMEREASON_STATE_SAVED;
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