Changeset 56581 in vbox for trunk/src/VBox
- Timestamp:
- Jun 22, 2015 4:48:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r56552 r56581 6240 6240 else 6241 6241 { 6242 VMRESUMEREASON enmReason = VMRESUMEREASON_USER;6242 VMRESUMEREASON enmReason; 6243 6243 if (aReason == Reason_HostResume) 6244 6244 { 6245 6245 /* 6246 6246 * 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. 6248 6248 * See @bugref{3495}. 6249 6249 * 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. 6251 6269 * See @bugref{7836}. 6252 6270 */ 6253 enmReason = VMRESUMEREASON_HOST_RESUME;6254 VMSTATE enmVMState = VMR3GetStateU(ptrVM.rawUVM());6255 if ( enmVMState == VMSTATE_RUNNING6256 || ( enmVMState== VMSTATE_SUSPENDED6257 && 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) 6258 6276 { 6277 LogRel(("Ignoring VM resume request, VM was paused in response to a host-suspend\n")); 6259 6278 return S_OK; 6260 6279 } 6261 } 6262 else if (aReason == Reason_Snapshot)6263 enmReason = VMRESUMEREASON_STATE_SAVED;6280 6281 enmReason = aReason == Reason_Snapshot ? VMRESUMEREASON_STATE_SAVED : VMRESUMEREASON_USER; 6282 } 6264 6283 6265 6284 // for snapshots: no state change callback, VBoxSVC does everything
Note:
See TracChangeset
for help on using the changeset viewer.