third_party/virtualbox/src/VBox/VMM/VMMR3/VM.cpp
/**
 * Does the state change callouts.
 *
 * The caller owns the AtStateCritSect.
 *
 * @param   pVM                 The cross context VM structure.
 * @param   pUVM                The UVM handle.
 * @param   enmStateNew         The New state.
 * @param   enmStateOld         The old state.
 */
Does the state change callouts.
The caller owns the AtStateCritSect.

@param   pVM                 The cross context VM structure.
@param   pUVM                The UVM handle.
@param   enmStateNew         The New state.
@param   enmStateOld         The old state.
Does the state change callouts . The caller owns the AtStateCritSect . @param pVM The cross context VM structure . @param pUVM The UVM handle . @param enmStateNew The New state . @param enmStateOld The old state .
static void vmR3DoAtState(PVM pVM, PUVM pUVM, VMSTATE enmStateNew, VMSTATE enmStateOld)
{
    LogRel(("Changing the VM state from '%s' to '%s'\n", VMR3GetStateName(enmStateOld),  VMR3GetStateName(enmStateNew)));
    for (PVMATSTATE pCur = pUVM->vm.s.pAtState; pCur; pCur = pCur->pNext)
    {
        pCur->pfnAtState(pUVM, enmStateNew, enmStateOld, pCur->pvUser);
        if (    enmStateNew     != VMSTATE_DESTROYING
            &&  pVM->enmVMState == VMSTATE_DESTROYING)
            break;
        AssertMsg(pVM->enmVMState == enmStateNew,
                  ("You are not allowed to change the state while in the change callback, except "
                   "from destroying the VM. There are restrictions in the way the state changes "
                   "are propagated up to the EM execution loop and it makes the program flow very "
                   "difficult to follow. (%s, expected %s, old %s)\n",
                   VMR3GetStateName(pVM->enmVMState), VMR3GetStateName(enmStateNew),
                   VMR3GetStateName(enmStateOld)));
    }
}
static void vmR3DoAtState ( PVM pVM , PUVM pUVM , VMSTATE enmStateNew , VMSTATE enmStateOld ) { LogRel ( ( " \n " , VMR3GetStateName ( enmStateOld ) , VMR3GetStateName ( enmStateNew ) ) ) ; for ( PVMATSTATE pCur = pUVM -> vm . s . pAtState ; pCur ; pCur = pCur -> pNext ) { pCur -> pfnAtState ( pUVM , enmStateNew , enmStateOld , pCur -> pvUser ) ; if ( enmStateNew != VMSTATE_DESTROYING && pVM -> enmVMState == VMSTATE_DESTROYING ) break ; AssertMsg ( pVM -> enmVMState == enmStateNew , ( " " " " " " " \n " , VMR3GetStateName ( pVM -> enmVMState ) , VMR3GetStateName ( enmStateNew ) , VMR3GetStateName ( enmStateOld ) ) ) ; } }
Does the state change callouts.
Does the state change callouts .