VirtualBox

Changeset 55721 in vbox


Ignore:
Timestamp:
May 7, 2015 12:42:12 PM (9 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Main
Files:
2 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;
  • trunk/src/VBox/Main/src-server/PerformanceImpl.cpp

    r51092 r55721  
    670670
    671671    int rc = RTTimerLRStop(m.sampler);
    672     AssertRC(rc);
     672    if (   RT_FAILURE(rc)
     673        && rc != VERR_TIMER_SUSPENDED)     /* calling suspendSampling() successively shouldn't assert. See @bugref{3495}. */
     674        AssertMsgFailed(("PerformanceCollector::suspendSampling(): RTTimerLRStop returned %Rrc\n", rc));
    673675}
    674676
     
    679681
    680682    int rc = RTTimerLRStart(m.sampler, 0);
    681     AssertRC(rc);
     683    if (   RT_FAILURE(rc)
     684        && rc != VERR_TIMER_ACTIVE)     /* calling resumeSampling() successively shouldn't assert. See @bugref{3495}. */
     685        AssertMsgFailed(("PerformanceCollector::resumeSampling(): RTTimerLRStart returned %Rrc\n", rc));
    682686}
    683687
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