VirtualBox

Changeset 6804 in vbox


Ignore:
Timestamp:
Feb 5, 2008 10:27:19 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27905
Message:

Fixed VMR3PowerOn regression.

The problem was that the EMT outer loop wasn't checking for state
changes in the init case (pUVM->pVM == NULL). So, if the VMR3PowerOn
request was queued and executed by the initial VMR3ReqProcessU call
we wouldn't call EMR3ExecuteVM when the VM state changed to running.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMEmt.cpp

    r6799 r6804  
    166166                ||  pUVM->vm.s.fTerminateEMT)
    167167                break;
    168 
    169             /*
    170              * Some requests (both VMR3Req* and the DBGF) can potentially
    171              * resume or start the VM, in that case we'll get a change in
    172              * VM status indicating that we're now running.
    173              */
    174             if (    VBOX_SUCCESS(rc)
    175                 &&  enmBefore != pVM->enmVMState
    176                 &&  (pVM->enmVMState == VMSTATE_RUNNING))
    177             {
    178                 rc = EMR3ExecuteVM(pVM);
    179                 Log(("vmR3EmulationThread: EMR3ExecuteVM() -> rc=%Vrc, enmVMState=%d\n", rc, pVM->enmVMState));
    180                 if (EMGetState(pVM) == EMSTATE_GURU_MEDITATION)
    181                     vmR3SetState(pVM, VMSTATE_GURU_MEDITATION);
    182             }
    183         }
     168        }
     169
     170        /*
     171         * Some requests (both VMR3Req* and the DBGF) can potentially
     172         * resume or start the VM, in that case we'll get a change in
     173         * VM status indicating that we're now running.
     174         */
     175        if (    VBOX_SUCCESS(rc)
     176            &&  pUVM->pVM
     177            &&  enmBefore != pUVM->pVM->enmVMState
     178            &&  pUVM->pVM->enmVMState == VMSTATE_RUNNING)
     179        {
     180            PVM pVM = pUVM->pVM;
     181            rc = EMR3ExecuteVM(pVM);
     182            Log(("vmR3EmulationThread: EMR3ExecuteVM() -> rc=%Vrc, enmVMState=%d\n", rc, pVM->enmVMState));
     183            if (EMGetState(pVM) == EMSTATE_GURU_MEDITATION)
     184                vmR3SetState(pVM, VMSTATE_GURU_MEDITATION);
     185        }
     186
    184187    } /* forever */
    185188
     
    336339    PVM pVM = pUVM->pVM;
    337340    int rc = VINF_SUCCESS;
    338     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     341    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    339342    //unsigned cLoops = 0;
    340343    for (;;)
     
    535538     */
    536539    int rc = VINF_SUCCESS;
    537     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     540    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    538541    unsigned cLoops = 0;
    539542    for (;; cLoops++)
     
    652655     */
    653656    int rc = VINF_SUCCESS;
    654     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     657    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    655658    unsigned cLoops = 0;
    656659    for (;; cLoops++)
     
    726729static DECLCALLBACK(int) vmR3HaltGlobal1Wait(PUVM pUVM)
    727730{
    728     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     731    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    729732
    730733    PVM pVM = pUVM->pVM;
     
    787790static DECLCALLBACK(int) vmR3BootstrapWait(PUVM pUVM)
    788791{
    789     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     792    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    790793
    791794    int rc = VINF_SUCCESS;
     
    852855static DECLCALLBACK(int) vmR3DefaultWait(PUVM pUVM)
    853856{
    854     ASMAtomicUoWriteBool(&pUVM->vm.s.fWait, true);
     857    ASMAtomicWriteBool(&pUVM->vm.s.fWait, true);
    855858
    856859    PVM pVM = pUVM->pVM;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette