VirtualBox

Changeset 36437 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Mar 25, 2011 3:36:59 PM (14 years ago)
Author:
vboxsync
Message:

VMM,Main: Added VMM thread init and term notifications so that Main can make sure COM is uninitialized. (Maybe we should just say IPRT cleans up COM?)

Location:
trunk/src/VBox/VMM/VMMR3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r36157 r36437  
    30293029    if (RT_SUCCESS(rc))
    30303030    {
    3031         rc = pVM->pUVM->pVmm2UserMethods->pfnSaveState(pVM->pUVM->pVmm2UserMethods, pVM);
     3031        PUVM pUVM = pVM->pUVM;
     3032        rc = pUVM->pVmm2UserMethods->pfnSaveState(pVM->pUVM->pVmm2UserMethods, pUVM);
    30323033
    30333034        /*
  • trunk/src/VBox/VMM/VMMR3/PDMThread.cpp

    r35346 r36437  
    759759    pThread->Thread = Thread;
    760760
     761    PUVM pUVM = pThread->Internal.s.pVM->pUVM;
     762    if (   pUVM->pVmm2UserMethods
     763        && pUVM->pVmm2UserMethods->pfnNotifyPdmtInit)
     764        pUVM->pVmm2UserMethods->pfnNotifyPdmtInit(pUVM->pVmm2UserMethods, pUVM);
     765
    761766    /*
    762767     * The run loop.
     
    840845    int rc2 = RTThreadUserSignal(Thread); AssertRC(rc2);
    841846
     847    if (   pUVM->pVmm2UserMethods
     848        && pUVM->pVmm2UserMethods->pfnNotifyPdmtTerm)
     849        pUVM->pVmm2UserMethods->pfnNotifyPdmtTerm(pUVM->pVmm2UserMethods, pUVM);
    842850    Log(("PDMThread: Terminating thread %RTthrd / %p / '%s': %Rrc\n", Thread, pThread, RTThreadGetName(Thread), rc));
    843851    return rc;
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r36041 r36437  
    169169 * @returns VBox error code on failure.
    170170 * @param   cCpus               Number of virtual CPUs for the new VM.
    171  * @param   pVmm2UserMethods    An optional method table that the VMM can use to
    172  *                              make the user perform various action, like for
    173  *                              instance state saving.
     171 * @param   pVmm2UserMethods    An optional method table that the VMM can use
     172 *                              to make the user perform various action, like
     173 *                              for instance state saving.
    174174 * @param   pfnVMAtError        Pointer to callback function for setting VM
    175  *                              errors. This was added as an implicit call to
     175 *                              errors.  This was added as an implicit call to
    176176 *                              VMR3AtErrorRegister() since there is no way the
    177177 *                              caller can get to the VM handle early enough to
     
    197197        AssertReturn(pVmm2UserMethods->u32Magic    == VMM2USERMETHODS_MAGIC,   VERR_INVALID_PARAMETER);
    198198        AssertReturn(pVmm2UserMethods->u32Version  == VMM2USERMETHODS_VERSION, VERR_INVALID_PARAMETER);
    199         AssertPtrReturn(pVmm2UserMethods->pfnSaveState, VERR_INVALID_POINTER);
     199        AssertPtrNullReturn(pVmm2UserMethods->pfnSaveState, VERR_INVALID_POINTER);
     200        AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyEmtInit, VERR_INVALID_POINTER);
     201        AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyEmtTerm, VERR_INVALID_POINTER);
     202        AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyPdmtInit, VERR_INVALID_POINTER);
     203        AssertPtrNullReturn(pVmm2UserMethods->pfnNotifyPdmtTerm, VERR_INVALID_POINTER);
    200204        AssertReturn(pVmm2UserMethods->u32EndMagic == VMM2USERMETHODS_MAGIC,   VERR_INVALID_PARAMETER);
    201205    }
  • trunk/src/VBox/VMM/VMMR3/VMEmt.cpp

    r36255 r36437  
    8181    AssertReleaseMsgRCReturn(rc, ("RTTlsSet %x failed with %Rrc\n", pUVM->vm.s.idxTLS, rc), rc);
    8282
     83    if (   pUVM->pVmm2UserMethods
     84        && pUVM->pVmm2UserMethods->pfnNotifyEmtInit)
     85        pUVM->pVmm2UserMethods->pfnNotifyEmtInit(pUVM->pVmm2UserMethods, pUVM, pUVCpu);
     86
    8387    /*
    8488     * The request loop.
     
    254258        AssertLogRelRC(rc2);
    255259    }
     260
     261    if (   pUVM->pVmm2UserMethods
     262        && pUVM->pVmm2UserMethods->pfnNotifyEmtTerm)
     263        pUVM->pVmm2UserMethods->pfnNotifyEmtTerm(pUVM->pVmm2UserMethods, pUVM, pUVCpu);
    256264
    257265    pUVCpu->vm.s.NativeThreadEMT = NIL_RTNATIVETHREAD;
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