VirtualBox

Changeset 56581 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 22, 2015 4:48:38 PM (9 years ago)
Author:
vboxsync
Message:

Main/ConsoleImpl: ignore 'regular' VM-resume requests when the VM has been suspended due to a host-suspend.

File:
1 edited

Legend:

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

    r56552 r56581  
    62406240    else
    62416241    {
    6242         VMRESUMEREASON enmReason = VMRESUMEREASON_USER;
     6242        VMRESUMEREASON enmReason;
    62436243        if (aReason == Reason_HostResume)
    62446244        {
    62456245            /*
    62466246             * Host resume may be called multiple times successively. We don't want to VMR3Resume->vmR3Resume->vmR3TrySetState()
    6247              * to assert on us, hence check for the VM state here and bail if it's already in the 'running' state.
     6247             * to assert on us, hence check for the VM state here and bail if it's not in the 'suspended' state.
    62486248             * See @bugref{3495}.
    62496249             *
    6250              * Also, don't resume the VM unless it was paused previously due to a host-suspend operation.
     6250             * Also, don't resume the VM through a host-resume unless it was suspended due to a host-suspend.
     6251             */
     6252            if (VMR3GetStateU(ptrVM.rawUVM()) != VMSTATE_SUSPENDED)
     6253            {
     6254                LogRel(("Ignoring host-resume VM resume request, VM is not currently suspended\n"));
     6255                return S_OK;
     6256            }
     6257            if (VMR3GetSuspendReason(ptrVM.rawUVM()) != VMSUSPENDREASON_HOST_SUSPEND)
     6258            {
     6259                LogRel(("Ignoring host-resume VM resume request, VM was not suspended due to host-suspend\n"));
     6260                return S_OK;
     6261            }
     6262
     6263            enmReason = VMRESUMEREASON_HOST_RESUME;
     6264        }
     6265        else
     6266        {
     6267            /*
     6268             * Any other reason to resume the VM is ignored when the VM was suspended due to a host suspend.
    62516269             * See @bugref{7836}.
    62526270             */
    6253             enmReason = VMRESUMEREASON_HOST_RESUME;
    6254             VMSTATE enmVMState = VMR3GetStateU(ptrVM.rawUVM());
    6255             if (   enmVMState == VMSTATE_RUNNING
    6256                 || (   enmVMState == VMSTATE_SUSPENDED
    6257                     && VMR3GetSuspendReason(ptrVM.rawUVM()) != VMSUSPENDREASON_HOST_SUSPEND))
     6271            /** @todo we need to return an error code when trying to resume a VM (using
     6272             *        "Reason_Unspecified") when the VM has been paused due to
     6273             *        host-suspend. */
     6274            if (   VMR3GetStateU(ptrVM.rawUVM()) == VMSTATE_SUSPENDED
     6275                && VMR3GetSuspendReason(ptrVM.rawUVM()) == VMSUSPENDREASON_HOST_SUSPEND)
    62586276            {
     6277                LogRel(("Ignoring VM resume request, VM was paused in response to a host-suspend\n"));
    62596278                return S_OK;
    62606279            }
    6261         }
    6262         else if (aReason == Reason_Snapshot)
    6263             enmReason = VMRESUMEREASON_STATE_SAVED;
     6280
     6281            enmReason = aReason == Reason_Snapshot ? VMRESUMEREASON_STATE_SAVED : VMRESUMEREASON_USER;
     6282        }
    62646283
    62656284        // for snapshots: no state change callback, VBoxSVC does everything
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