VirtualBox

Changeset 23915 in vbox


Ignore:
Timestamp:
Oct 20, 2009 5:06:58 PM (15 years ago)
Author:
vboxsync
Message:

VM,PDMDevHlp,PDMDrvHlp: VM[R3]TeleportedAndNotFullyResumedYet (horrible name).

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmdev.h

    r22480 r23915  
    21772177
    21782178    /**
     2179     * Gets the VM state.
     2180     *
     2181     * @returns VM state.
     2182     * @param   pDevIns             The device instance.
     2183     * @thread  Any thread (just keep in mind that it's volatile info).
     2184     */
     2185    DECLR3CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDEVINS pDevIns));
     2186
     2187    /**
     2188     * Checks if the VM was teleported and hasn't been fully resumed yet.
     2189     *
     2190     * @returns true / false.
     2191     * @param   pDevIns             The device instance.
     2192     * @thread  Any thread.
     2193     */
     2194    DECLR3CALLBACKMEMBER(bool, pfnVMTeleportedAndNotFullyResumedYet,(PPDMDEVINS pDevIns));
     2195
     2196    /**
    21792197     * Assert that the current thread is the emulation thread.
    21802198     *
     
    23682386    DECLR3CALLBACKMEMBER(int, pfnPhysGCPtr2GCPhys, (PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys));
    23692387
    2370     /**
    2371      * Gets the VM state.
    2372      *
    2373      * @returns VM state.
    2374      * @param   pDevIns             The device instance.
    2375      * @thread  Any thread (just keep in mind that it's volatile info).
    2376      */
    2377     DECLR3CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDEVINS pDevIns));
    2378 
    23792388    /** Space reserved for future members.
    23802389     * @{ */
     2390    DECLR3CALLBACKMEMBER(void, pfnReserved1,(void));
     2391    DECLR3CALLBACKMEMBER(void, pfnReserved2,(void));
     2392    DECLR3CALLBACKMEMBER(void, pfnReserved3,(void));
    23812393    DECLR3CALLBACKMEMBER(void, pfnReserved4,(void));
    23822394    DECLR3CALLBACKMEMBER(void, pfnReserved5,(void));
     
    36723684
    36733685/**
     3686 * @copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet
     3687 */
     3688DECLINLINE(bool) PDMDevHlpVMTeleportedAndNotFullyResumedYet(PPDMDEVINS pDevIns)
     3689{
     3690    return pDevIns->pDevHlpR3->pfnVMTeleportedAndNotFullyResumedYet(pDevIns);
     3691}
     3692
     3693/**
    36743694 * @copydoc PDMDEVHLPR3::pfnA20Set
    36753695 */
  • trunk/include/VBox/pdmdrv.h

    r22480 r23915  
    501501
    502502    /**
     503     * Gets the VM state.
     504     *
     505     * @returns VM state.
     506     * @param   pDrvIns         The driver instance.
     507     * @thread  Any thread (just keep in mind that it's volatile info).
     508     */
     509    DECLR3CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDRVINS pDrvIns));
     510
     511    /**
     512     * Checks if the VM was teleported and hasn't been fully resumed yet.
     513     *
     514     * @returns true / false.
     515     * @param   pDrvIns         The driver instance.
     516     * @thread  Any thread.
     517     */
     518    DECLR3CALLBACKMEMBER(bool, pfnVMTeleportedAndNotFullyResumedYet,(PPDMDRVINS pDrvIns));
     519
     520    /**
    503521     * Create a queue.
    504522     *
     
    698716    DECLR3CALLBACKMEMBER(int, pfnPDMThreadCreate,(PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread,
    699717                                                  PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName));
    700 
    701     /**
    702      * Gets the VM state.
    703      *
    704      * @returns VM state.
    705      * @param   pDrvIns         The driver instance.
    706      * @thread  Any thread (just keep in mind that it's volatile info).
    707      */
    708     DECLR3CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDRVINS pDrvIns));
    709718
    710719#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
     
    883892
    884893/**
     894 * @copydoc PDMDRVHLP::pfnVMState
     895 */
     896DECLINLINE(VMSTATE) PDMDrvHlpVMState(PPDMDRVINS pDrvIns)
     897{
     898    return pDrvIns->pDrvHlp->pfnVMState(pDrvIns);
     899}
     900
     901/**
     902 * @copydoc PDMDRVHLP::pfnVMTeleportedAndNotFullyResumedYet
     903 */
     904DECLINLINE(bool) PDMDrvHlpVMTeleportedAndNotFullyResumedYet(PPDMDRVINS pDrvIns)
     905{
     906    return pDrvIns->pDrvHlp->pfnVMTeleportedAndNotFullyResumedYet(pDrvIns);
     907}
     908
     909/**
    885910 * @copydoc PDMDRVHLP::pfnPDMQueueCreate
    886911 */
     
    10091034}
    10101035
    1011 /**
    1012  * @copydoc PDMDRVHLP::pfnVMState
    1013  */
    1014 DECLINLINE(VMSTATE) PDMDrvHlpVMState(PPDMDRVINS pDrvIns)
    1015 {
    1016     return pDrvIns->pDrvHlp->pfnVMState(pDrvIns);
    1017 }
    1018 
    10191036#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    10201037/**
  • trunk/include/VBox/vmapi.h

    r23801 r23915  
    361361VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
    362362VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
     363VMMR3DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
    363364VMMR3DECL(int)  VMR3AtErrorRegister(PVM pVM, PFNVMATERROR pfnAtError, void *pvUser);
    364365VMMR3DECL(int)  VMR3AtErrorRegisterU(PUVM pVM, PFNVMATERROR pfnAtError, void *pvUser);
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r23011 r23915  
    10341034
    10351035
     1036/** @copydoc PDMDEVHLPR3::pfnVMState */
     1037static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns)
     1038{
     1039    PDMDEV_ASSERT_DEVINS(pDevIns);
     1040
     1041    VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMR3);
     1042
     1043    LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance,
     1044             enmVMState, VMR3GetStateName(enmVMState)));
     1045    return enmVMState;
     1046}
     1047
     1048
     1049/** @copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet */
     1050static DECLCALLBACK(bool) pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet(PPDMDEVINS pDevIns)
     1051{
     1052    PDMDEV_ASSERT_DEVINS(pDevIns);
     1053
     1054    bool fRc = VMR3TeleportedAndNotFullyResumedYet(pDevIns->Internal.s.pVMR3);
     1055
     1056    LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %RTbool\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance,
     1057             fRc));
     1058    return fRc;
     1059}
     1060
     1061
    10361062/** @copydoc PDMDEVHLPR3::pfnAssertEMT */
    10371063static DECLCALLBACK(bool) pdmR3DevHlp_AssertEMT(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)
     
    22742300
    22752301    return rc;
    2276 }
    2277 
    2278 
    2279 /** @copydoc PDMDEVHLPR3::pfnVMState */
    2280 static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns)
    2281 {
    2282     PDMDEV_ASSERT_DEVINS(pDevIns);
    2283 
    2284     VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMR3);
    2285 
    2286     LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance,
    2287              enmVMState, VMR3GetStateName(enmVMState)));
    2288     return enmVMState;
    22892302}
    22902303
     
    27832796    pdmR3DevHlp_VMSetRuntimeError,
    27842797    pdmR3DevHlp_VMSetRuntimeErrorV,
     2798    pdmR3DevHlp_VMState,
     2799    pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet,
    27852800    pdmR3DevHlp_AssertEMT,
    27862801    pdmR3DevHlp_AssertOther,
     
    27962811    pdmR3DevHlp_PDMThreadCreate,
    27972812    pdmR3DevHlp_PhysGCPtr2GCPhys,
    2798     pdmR3DevHlp_VMState,
     2813    0,
     2814    0,
     2815    0,
    27992816    0,
    28002817    0,
     
    32443261    pdmR3DevHlp_VMSetRuntimeError,
    32453262    pdmR3DevHlp_VMSetRuntimeErrorV,
     3263    pdmR3DevHlp_VMState,
     3264    pdmR3DevHlp_VMTeleportedAndNotFullyResumedYet,
    32463265    pdmR3DevHlp_AssertEMT,
    32473266    pdmR3DevHlp_AssertOther,
     
    32573276    pdmR3DevHlp_PDMThreadCreate,
    32583277    pdmR3DevHlp_PhysGCPtr2GCPhys,
    3259     pdmR3DevHlp_VMState,
     3278    0,
     3279    0,
     3280    0,
    32603281    0,
    32613282    0,
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r22480 r23915  
    798798
    799799
     800/** @copydoc PDMDEVHLPR3::pfnVMState */
     801static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns)
     802{
     803    PDMDRV_ASSERT_DRVINS(pDrvIns);
     804
     805    VMSTATE enmVMState = VMR3GetState(pDrvIns->Internal.s.pVM);
     806
     807    LogFlow(("pdmR3DrvHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance,
     808             enmVMState, VMR3GetStateName(enmVMState)));
     809    return enmVMState;
     810}
     811
     812
     813/** @copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet */
     814static DECLCALLBACK(bool) pdmR3DrvHlp_VMTeleportedAndNotFullyResumedYet(PPDMDRVINS pDrvIns)
     815{
     816    PDMDRV_ASSERT_DRVINS(pDrvIns);
     817
     818    bool fRc = VMR3TeleportedAndNotFullyResumedYet(pDrvIns->Internal.s.pVM);
     819
     820    LogFlow(("pdmR3DrvHlp_VMState: caller='%s'/%d: returns %RTbool)\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance,
     821             fRc));
     822    return fRc;
     823}
     824
     825
    800826/** @copydoc PDMDRVHLP::pfnPDMQueueCreate */
    801827static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     
    9991025            rc, *ppThread));
    10001026    return rc;
    1001 }
    1002 
    1003 
    1004 /** @copydoc PDMDEVHLPR3::pfnVMState */
    1005 static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns)
    1006 {
    1007     PDMDRV_ASSERT_DRVINS(pDrvIns);
    1008 
    1009     VMSTATE enmVMState = VMR3GetState(pDrvIns->Internal.s.pVM);
    1010 
    1011     LogFlow(("pdmR3DrvHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance,
    1012              enmVMState, VMR3GetStateName(enmVMState)));
    1013     return enmVMState;
    10141027}
    10151028
     
    10511064    pdmR3DrvHlp_VMSetRuntimeError,
    10521065    pdmR3DrvHlp_VMSetRuntimeErrorV,
     1066    pdmR3DrvHlp_VMState,
     1067    pdmR3DrvHlp_VMTeleportedAndNotFullyResumedYet,
    10531068    pdmR3DrvHlp_PDMQueueCreate,
    10541069    pdmR3DrvHlp_TMGetVirtualFreq,
     
    10641079    pdmR3DrvHlp_USBRegisterHub,
    10651080    pdmR3DrvHlp_PDMThreadCreate,
    1066     pdmR3DrvHlp_VMState,
    10671081#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    10681082    pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate,
  • trunk/src/VBox/VMM/VM.cpp

    r23904 r23915  
    13461346        PDMR3Resume(pVM);
    13471347        vmR3SetState(pVM, VMSTATE_RUNNING, VMSTATE_RESUMING);
     1348        pVM->vm.s.fTeleportedAndNotFullyResumedYet = false;
    13481349    }
    13491350
     
    16121613    else if (rc == 2 || enmAfter == SSMAFTER_TELEPORT)
    16131614    {
     1615        if (enmAfter == SSMAFTER_TELEPORT)
     1616            pVM->vm.s.fTeleportedAndNotFullyResumedYet = true;
    16141617        rc = SSMR3LiveSave(pVM, pszFilename, pStreamOps, pvStreamOpsUser,
    16151618                           enmAfter, pfnProgress, pvProgressUser, ppSSM);
     
    31803183
    31813184/**
     3185 * Checks if the VM was teleported and hasn't been fully resumed yet.
     3186 *
     3187 * @returns true / false.
     3188 * @param   pVM                 The VM handle.
     3189 * @thread  Any thread.
     3190 */
     3191VMMR3DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM)
     3192{
     3193    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     3194    return pVM->vm.s.fTeleportedAndNotFullyResumedYet;
     3195}
     3196
     3197
     3198/**
    31823199 * Registers a VM state change callback.
    31833200 *
  • trunk/src/VBox/VMM/VMInternal.h

    r23009 r23915  
    166166    /** VM Runtime Error Message. */
    167167    R3PTRTYPE(PVMRUNTIMEERROR)      pRuntimeErrorR3;
     168    /** The VM was/is-being teleported and has not yet been fully resumed. */
     169    bool                            fTeleportedAndNotFullyResumedYet;
    168170} VMINT;
    169171/** Pointer to the VM Internal Data (part of the VM structure). */
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