third_party/virtualbox/src/VBox/VMM/VMMR3/VM.cpp
/**
 * Sets the current VM state, with the AtStatCritSect already entered.
 *
 * @param   pVM                     The cross context VM structure.
 * @param   pUVM                    The UVM handle.
 * @param   enmStateNew             The new state.
 * @param   enmStateOld             The old state.
 * @param   fSetRatherThanClearFF   The usual behavior is to clear the
 *                                  VM_FF_CHECK_VM_STATE force flag, but for
 *                                  some transitions (-> guru) we need to kick
 *                                  the other EMTs to stop what they're doing.
 */
Sets the current VM state, with the AtStatCritSect already entered.
@param   pVM                     The cross context VM structure.
@param   pUVM                    The UVM handle.
@param   enmStateNew             The new state.
@param   enmStateOld             The old state.
@param   fSetRatherThanClearFF   The usual behavior is to clear the
VM_FF_CHECK_VM_STATE force flag, but for
some transitions (-> guru) we need to kick
the other EMTs to stop what they're doing.
Sets the current VM state with the AtStatCritSect already entered . @param pVM The cross context VM structure . @param pUVM The UVM handle . @param enmStateNew The new state . @param enmStateOld The old state . @param fSetRatherThanClearFF The usual behavior is to clear the VM_FF_CHECK_VM_STATE force flag but for some transitions ( - > guru ) we need to kick the other EMTs to stop what they ' re doing .
static void vmR3SetStateLocked(PVM pVM, PUVM pUVM, VMSTATE enmStateNew, VMSTATE enmStateOld, bool fSetRatherThanClearFF)
{
    vmR3ValidateStateTransition(enmStateOld, enmStateNew);
    AssertMsg(pVM->enmVMState == enmStateOld,
              ("%s != %s\n", VMR3GetStateName(pVM->enmVMState), VMR3GetStateName(enmStateOld)));
    pUVM->vm.s.enmPrevVMState = enmStateOld;
    pVM->enmVMState           = enmStateNew;
    if (!fSetRatherThanClearFF)
        VM_FF_CLEAR(pVM, VM_FF_CHECK_VM_STATE);
    else if (pVM->cCpus > 0)
        VM_FF_SET(pVM, VM_FF_CHECK_VM_STATE);
    vmR3DoAtState(pVM, pUVM, enmStateNew, enmStateOld);
}
static void vmR3SetStateLocked ( PVM pVM , PUVM pUVM , VMSTATE enmStateNew , VMSTATE enmStateOld , bool fSetRatherThanClearFF ) { vmR3ValidateStateTransition ( enmStateOld , enmStateNew ) ; AssertMsg ( pVM -> enmVMState == enmStateOld , ( " \n " , VMR3GetStateName ( pVM -> enmVMState ) , VMR3GetStateName ( enmStateOld ) ) ) ; pUVM -> vm . s . enmPrevVMState = enmStateOld ; pVM -> enmVMState = enmStateNew ; if ( ! fSetRatherThanClearFF ) VM_FF_CLEAR ( pVM , VM_FF_CHECK_VM_STATE ) ; else if ( pVM -> cCpus > 0 ) VM_FF_SET ( pVM , VM_FF_CHECK_VM_STATE ) ; vmR3DoAtState ( pVM , pUVM , enmStateNew , enmStateOld ) ; }
Sets the current VM state, with the AtStatCritSect already entered.
Sets the current VM state with the AtStatCritSect already entered .