VirtualBox

Changeset 44393 in vbox for trunk


Ignore:
Timestamp:
Jan 25, 2013 9:21:05 PM (12 years ago)
Author:
vboxsync
Message:

VM,++: Changed the VM callbacks (at error, at runtime error, at state change) to use PUVM instead of PVM.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vmapi.h

    r44340 r44393  
    9393 * VM error callback function.
    9494 *
    95  * @param   pVM             The VM handle. Can be NULL if an error occurred before
    96  *                          successfully creating a VM.
     95 * @param   pUVM            The user mode VM handle.  Can be NULL if an error
     96 *                          occurred before successfully creating a VM.
    9797 * @param   pvUser          The user argument.
    9898 * @param   rc              VBox status code.
     
    101101 * @param   args            Error message arguments.
    102102 */
    103 typedef DECLCALLBACK(void) FNVMATERROR(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
     103typedef DECLCALLBACK(void) FNVMATERROR(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
    104104/** Pointer to a VM error callback. */
    105105typedef FNVMATERROR *PFNVMATERROR;
     
    129129 * See VMSetRuntimeError for the detailed description of parameters.
    130130 *
    131  * @param   pVM             The VM handle.
     131 * @param   pUVM            The user mode VM handle.
    132132 * @param   pvUser          The user argument.
    133133 * @param   fFlags          The error flags.
     
    136136 * @param   va              Error message arguments.
    137137 */
    138 typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
     138typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
    139139                                              const char *pszFormat, va_list va);
    140140/** Pointer to a VM runtime error callback. */
     
    164164
    165165/**
    166  * VM state callback function.
     166 * VM state change callback function.
    167167 *
    168168 * You are not allowed to call any function which changes the VM state from a
    169169 * state callback, except VMR3Destroy().
    170170 *
    171  * @param   pVM         The VM handle.
     171 * @param   pUVM        The user mode VM handle.
    172172 * @param   enmState    The new state.
    173173 * @param   enmOldState The old state.
    174174 * @param   pvUser      The user argument.
    175175 */
    176 typedef DECLCALLBACK(void) FNVMATSTATE(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
     176typedef DECLCALLBACK(void) FNVMATSTATE(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
    177177/** Pointer to a VM state callback. */
    178178typedef FNVMATSTATE *PFNVMATSTATE;
     
    318318/**
    319319 * Progress callback.
     320 *
    320321 * This will report the completion percentage of an operation.
    321322 *
    322323 * @returns VINF_SUCCESS.
    323324 * @returns Error code to cancel the operation with.
    324  * @param   pVM         The VM handle.
     325 * @param   pUVM        The user mode VM handle.
    325326 * @param   uPercent    Completion percentage (0-100).
    326327 * @param   pvUser      User specified argument.
    327328 */
    328 typedef DECLCALLBACK(int) FNVMPROGRESS(PVM pVM, unsigned uPercent, void *pvUser);
     329typedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
    329330/** Pointer to a FNVMPROGRESS function. */
    330331typedef FNVMPROGRESS *PFNVMPROGRESS;
    331 
    332 /**
    333  * VM destruction callback.
    334  * @param   pVM     The VM which is about to be destroyed.
    335  * @param   pvUser  The user parameter specified at registration.
    336  */
    337 typedef DECLCALLBACK(void) FNVMATDTOR(PVM pVM, void *pvUser);
    338 /** Pointer to a VM destruction callback. */
    339 typedef FNVMATDTOR *PFNVMATDTOR;
    340332
    341333
  • trunk/src/VBox/Debugger/VBoxDbgBase.cpp

    r44348 r44393  
    104104
    105105/*static*/ DECLCALLBACK(void)
    106 VBoxDbgBase::atStateChange(PVM pVM, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
    107 {
    108     VBoxDbgBase *pThis = (VBoxDbgBase *)pvUser; NOREF(pVM);
     106VBoxDbgBase::atStateChange(PUVM pUVM, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
     107{
     108    VBoxDbgBase *pThis = (VBoxDbgBase *)pvUser; NOREF(pUVM);
    109109    switch (enmState)
    110110    {
     
    112112        {
    113113            /** @todo need to do some locking here?  */
    114             PUVM pUVM = ASMAtomicXchgPtrT(&pThis->m_pUVM, NULL, PUVM);
    115             if (pUVM)
     114            PUVM pUVM2 = ASMAtomicXchgPtrT(&pThis->m_pUVM, NULL, PUVM);
     115            if (pUVM2)
    116116            {
     117                Assert(pUVM2 == pUVM);
    117118                pThis->sigTerminated();
    118                 VMR3ReleaseUVM(pUVM);
     119                VMR3ReleaseUVM(pUVM2);
    119120            }
    120121            break;
  • trunk/src/VBox/Debugger/VBoxDbgBase.h

    r44340 r44393  
    104104
    105105private:
    106     /**
    107      * VM state callback function.
    108      *
    109      * You are not allowed to call any function which changes the VM state from a
    110      * state callback, except VMR3Destroy().
    111      *
    112      * @param   pVM         The VM handle.
    113      * @param   enmState    The new state.
    114      * @param   enmOldState The old state.
    115      * @param   pvUser      The user argument.
    116      */
    117     static DECLCALLBACK(void) atStateChange(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
     106    /** @callback_method_impl{FNVMATSTATE}  */
     107    static DECLCALLBACK(void) atStateChange(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
    118108
    119109private:
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r44387 r44393  
    596596    static DECLCALLBACK(int) configGuestProperties(void *pvConsole, PUVM pUVM);
    597597    static DECLCALLBACK(int) configGuestControl(void *pvConsole);
    598     static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState,
    599                                                     VMSTATE aOldState, void *aUser);
     598    static DECLCALLBACK(void) vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
    600599    static DECLCALLBACK(int) unplugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
    601600    static DECLCALLBACK(int) plugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
     
    640639    static DECLCALLBACK(int)    fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
    641640
    642     static DECLCALLBACK(int)    stateProgressCallback(PVM pVM, unsigned uPercent, void *pvUser);
    643 
    644     static DECLCALLBACK(void)   genericVMSetErrorCallback(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
     641    static DECLCALLBACK(int)    stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser);
     642
     643    static DECLCALLBACK(void)   genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL,
    645644                                                          const char *pszErrorFmt, va_list va);
    646645
    647646    void                        setVMRuntimeErrorCallbackF(uint32_t fFatal, const char *pszErrorId, const char *pszFormat, ...);
    648     static DECLCALLBACK(void)   setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFatal,
     647    static DECLCALLBACK(void)   setVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFatal,
    649648                                                          const char *pszErrorId, const char *pszFormat, va_list va);
    650649
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r44374 r44393  
    38993899        {
    39003900            /* too bad, we failed. try to sync the console state with the VMM state */
    3901             vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);
     3901            vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole);
    39023902        }
    39033903        /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume
     
    41444144        {
    41454145            /* too bad, we failed. try to sync the console state with the VMM state */
    4146             vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);
    4147         }
    4148         /** @todo: if we failed with drive mount, then the VMR3Resume
     4146            vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole);
     4147        }
     4148        /** @todo  if we failed with drive mount, then the VMR3Resume
    41494149         * error (if any) will be hidden from the caller. For proper reporting
    41504150         * of such multiple errors to the caller we need to enhance the
     
    43974397        {
    43984398            /* too bad, we failed. try to sync the console state with the VMM state */
    4399             vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);
     4399            vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole);
    44004400        }
    44014401        /** @todo: if we failed with drive mount, then the VMR3Resume
     
    47754775        {
    47764776            /* too bad, we failed. try to sync the console state with the VMM state */
    4777             vmstateChangeCallback(VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pThis);
     4777            vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pThis);
    47784778        }
    47794779        /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume
     
    57515751            /* too bad, we failed. try to sync the console state with the VMM state */
    57525752            AssertLogRelRC(vrc2);
    5753             vmstateChangeCallback(ptrVM.raw(), VMSTATE_SUSPENDED, enmVMState, this);
     5753            vmstateChangeCallback(ptrVM.rawUVM(), VMSTATE_SUSPENDED, enmVMState, this);
    57545754        }
    57555755    }
     
    58275827        {
    58285828            /* too bad, we failed. try to sync the console state with the VMM state */
    5829             vmstateChangeCallback(ptrVM.raw(), VMSTATE_SUSPENDED, enmVMState, this);
     5829            vmstateChangeCallback(ptrVM.rawUVM(), VMSTATE_SUSPENDED, enmVMState, this);
    58305830        }
    58315831    }
     
    74967496}
    74977497
    7498 /**
    7499  * VM state callback function. Called by the VMM
    7500  * using its state machine states.
    7501  *
    7502  * Primarily used to handle VM initiated power off, suspend and state saving,
    7503  * but also for doing termination completed work (VMSTATE_TERMINATE).
    7504  *
    7505  * In general this function is called in the context of the EMT.
    7506  *
    7507  * @param   aVM         The VM handle.
    7508  * @param   aState      The new state.
    7509  * @param   aOldState   The old state.
    7510  * @param   aUser       The user argument (pointer to the Console object).
    7511  *
    7512  * @note Locks the Console object for writing.
     7498/** @callback_method_impl{FNVMATSTATE}
     7499 *
     7500 * @note    Locks the Console object for writing.
     7501 * @remarks The @a pUVM parameter can be NULL in one case where powerUpThread()
     7502 *          calls after the VM was destroyed.
    75137503 */
    7514 DECLCALLBACK(void) Console::vmstateChangeCallback(PVM aVM,
    7515                                                   VMSTATE aState,
    7516                                                   VMSTATE aOldState,
    7517                                                   void *aUser)
    7518 {
    7519     LogFlowFunc(("Changing state from %s to %s (aVM=%p)\n",
    7520                  VMR3GetStateName(aOldState), VMR3GetStateName(aState), aVM));
    7521 
    7522     Console *that = static_cast<Console *>(aUser);
     7504DECLCALLBACK(void) Console::vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser)
     7505{
     7506    LogFlowFunc(("Changing state from %s to %s (pUVM=%p)\n",
     7507                 VMR3GetStateName(enmOldState), VMR3GetStateName(enmState),     pUVM));
     7508
     7509    Console *that = static_cast<Console *>(pvUser);
    75237510    AssertReturnVoid(that);
    75247511
     
    75327519                     || autoCaller.state() == InUninit);
    75337520
    7534     switch (aState)
     7521    switch (enmState)
    75357522    {
    75367523        /*
     
    76207607                break;
    76217608
    7622             /* Terminate host interface networking. If aVM is NULL, we've been
     7609            /* Terminate host interface networking. If pUVM is NULL, we've been
    76237610             * manually called from powerUpThread() either before calling
    76247611             * VMR3Create() or after VMR3Create() failed, so no need to touch
    76257612             * networking.
    76267613             */
    7627             if (aVM)
     7614            if (pUVM)
    76287615                that->powerDownHostInterfaces();
    76297616
     
    77407727
    77417728                default:
    7742                     AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState),  VMR3GetStateName(aState) ));
     7729                    AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState),  VMR3GetStateName(enmState) ));
    77437730                    that->setMachineState(MachineState_Paused);
    77447731                    break;
     
    77497736        case VMSTATE_RUNNING:
    77507737        {
    7751             if (   aOldState == VMSTATE_POWERING_ON
    7752                 || aOldState == VMSTATE_RESUMING
    7753                 || aOldState == VMSTATE_RUNNING_FT)
     7738            if (   enmOldState == VMSTATE_POWERING_ON
     7739                || enmOldState == VMSTATE_RESUMING
     7740                || enmOldState == VMSTATE_RUNNING_FT)
    77547741            {
    77557742                AutoWriteLock alock(that COMMA_LOCKVAL_SRC_POS);
     
    77607747                Assert(   (   (   that->mMachineState == MachineState_Starting
    77617748                               || that->mMachineState == MachineState_Paused)
    7762                            && aOldState == VMSTATE_POWERING_ON)
     7749                           && enmOldState == VMSTATE_POWERING_ON)
    77637750                       || (   (   that->mMachineState == MachineState_Restoring
    77647751                               || that->mMachineState == MachineState_TeleportingIn
     
    77667753                               || that->mMachineState == MachineState_Saving
    77677754                              )
    7768                            && aOldState == VMSTATE_RESUMING)
     7755                           && enmOldState == VMSTATE_RESUMING)
    77697756                       || (   that->mMachineState == MachineState_FaultTolerantSyncing
    7770                            && aOldState == VMSTATE_RUNNING_FT));
     7757                           && enmOldState == VMSTATE_RUNNING_FT));
    77717758
    77727759                that->setMachineState(MachineState_Running);
     
    77797766            AssertMsg(   that->mMachineState == MachineState_LiveSnapshotting
    77807767                      || that->mMachineState == MachineState_Teleporting,
    7781                       ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState),  VMR3GetStateName(aState) ));
     7768                      ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState),  VMR3GetStateName(enmState) ));
    77827769            break;
    77837770
    77847771        case VMSTATE_RUNNING_FT:
    77857772            AssertMsg(that->mMachineState == MachineState_FaultTolerantSyncing,
    7786                       ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(aOldState),  VMR3GetStateName(aState) ));
     7773                      ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState),  VMR3GetStateName(enmState) ));
    77877774            break;
    77887775
     
    84088395 * and VMR3Teleport.
    84098396 *
    8410  * @param   pVM         The VM handle.
     8397 * @param   pUVM        The user mode VM handle.
    84118398 * @param   uPercent    Completion percentage (0-100).
    84128399 * @param   pvUser      Pointer to an IProgress instance.
     
    84148401 */
    84158402/*static*/
    8416 DECLCALLBACK(int) Console::stateProgressCallback(PVM pVM, unsigned uPercent, void *pvUser)
     8403DECLCALLBACK(int) Console::stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser)
    84178404{
    84188405    IProgress *pProgress = static_cast<IProgress *>(pvUser);
     
    84228409        pProgress->SetCurrentOperationProgress(uPercent);
    84238410
     8411    NOREF(pUVM);
    84248412    return VINF_SUCCESS;
    84258413}
     
    84328420 */
    84338421/*static*/ DECLCALLBACK(void)
    8434 Console::genericVMSetErrorCallback(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
     8422Console::genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL,
    84358423                                   const char *pszErrorFmt, va_list va)
    84368424{
     
    84508438
    84518439    va_end(va2);
     8440
     8441    NOREF(pUVM);
    84528442}
    84538443
     
    84568446 * See VMSetRuntimeError for the detailed description of parameters.
    84578447 *
    8458  * @param   pVM             The VM handle.  Ignored, so passing NULL is fine.
     8448 * @param   pUVM            The user mode VM handle.  Ignored, so passing NULL
     8449 *                          is fine.
    84598450 * @param   pvUser          The user argument, pointer to the Console instance.
    84608451 * @param   fFlags          The action flags. See VMSETRTERR_FLAGS_*.
     
    84658456 */
    84668457/* static */ DECLCALLBACK(void)
    8467 Console::setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFlags,
     8458Console::setVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFlags,
    84688459                                   const char *pszErrorId,
    84698460                                   const char *pszFormat, va_list va)
     
    84788469
    84798470    LogRel(("Console: VM runtime error: fatal=%RTbool, errorID=%s message=\"%s\"\n",
    8480              fFatal, pszErrorId, message.c_str()));
    8481 
    8482     that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId).raw(),
    8483                          Bstr(message).raw());
    8484 
    8485     LogFlowFuncLeave();
     8471            fFatal, pszErrorId, message.c_str()));
     8472
     8473    that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId).raw(), Bstr(message).raw());
     8474
     8475    LogFlowFuncLeave(); NOREF(pUVM);
    84868476}
    84878477
     
    91529142
    91539143        Assert(pConsole->mpUVM == NULL);
    9154         vmstateChangeCallback(NULL, VMSTATE_TERMINATED, VMSTATE_CREATING,
    9155                               pConsole);
     9144        vmstateChangeCallback(NULL, VMSTATE_TERMINATED, VMSTATE_CREATING, pConsole);
    91569145    }
    91579146
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r44387 r44393  
    161161    for (int i = 0; i < 2; i++)
    162162    {
    163         inputStruct.key = (uint32_t)((i == 0) ? 'OSK0' : 'OSK1');
     163        inputStruct.key = (uint32_t)(i == 0 ? 'OSK0' : 'OSK1');
    164164        kr = IOConnectCallStructMethod((mach_port_t)port,
    165165                                       (uint32_t)2,
  • trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp

    r44347 r44393  
    585585 * @copydoc PFNVMPROGRESS
    586586 */
    587 static DECLCALLBACK(int) teleporterProgressCallback(PVM pVM, unsigned uPercent, void *pvUser)
     587static DECLCALLBACK(int) teleporterProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser)
    588588{
    589589    TeleporterState *pState = (TeleporterState *)pvUser;
     
    604604    }
    605605
     606    NOREF(pUVM);
    606607    return VINF_SUCCESS;
    607608}
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r44340 r44393  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    625625#include "PGMInternal.h"
    626626#include <VBox/vmm/vm.h>
     627#include <VBox/vmm/uvm.h>
    627628#include "PGMInline.h"
    628629
     
    653654static DECLCALLBACK(int)  pgmR3RelocateHyperVirtHandler(PAVLROGCPTRNODECORE pNode, void *pvUser);
    654655#ifdef VBOX_STRICT
    655 static DECLCALLBACK(void) pgmR3ResetNoMorePhysWritesFlag(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
     656static FNVMATSTATE        pgmR3ResetNoMorePhysWritesFlag;
    656657#endif
    657658static int                pgmR3ModeDataInit(PVM pVM, bool fResolveGCAndR0);
     
    26012602 * a snapshot has been created.
    26022603 */
    2603 static DECLCALLBACK(void) pgmR3ResetNoMorePhysWritesFlag(PVM pVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser)
     2604static DECLCALLBACK(void) pgmR3ResetNoMorePhysWritesFlag(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser)
    26042605{
    26052606    if (   enmState == VMSTATE_RUNNING
    26062607        || enmState == VMSTATE_RESUMING)
    2607         pVM->pgm.s.fNoMorePhysWrites = false;
     2608        pUVM->pVM->pgm.s.fNoMorePhysWrites = false;
    26082609    NOREF(enmOldState); NOREF(pvUser);
    26092610}
  • trunk/src/VBox/VMM/VMMR3/SSM.cpp

    r44347 r44393  
    10931093            pSSM->uPercent = uPct;
    10941094            if (pSSM->pfnProgress)
    1095                 pSSM->pfnProgress(pVM, RT_MIN(uPct, 100 - pSSM->uPercentDone), pSSM->pvUser);
     1095                pSSM->pfnProgress(pVM->pUVM, RT_MIN(uPct, 100 - pSSM->uPercentDone), pSSM->pvUser);
    10961096        }
    10971097    }
     
    29882988        {
    29892989            if (pSSM->pfnProgress)
    2990                 pSSM->pfnProgress(pSSM->pVM, pSSM->uPercent, pSSM->pvUser);
     2990                pSSM->pfnProgress(pSSM->pVM->pUVM, pSSM->uPercent, pSSM->pvUser);
    29912991            pSSM->uPercent++;
    29922992            pSSM->offEstProgress = (pSSM->uPercent - pSSM->uPercentPrepare - pSSM->uPercentLive) * pSSM->cbEstTotal
     
    43184318        Assert(pSSM->enmOp == SSMSTATE_SAVE_DONE);
    43194319        if (pSSM->pfnProgress)
    4320             pSSM->pfnProgress(pVM, 100, pSSM->pvUser);
     4320            pSSM->pfnProgress(pVM->pUVM, 100, pSSM->pvUser);
    43214321        LogRel(("SSM: Successfully saved the VM state to '%s'\n",
    43224322                pSSM->pszFilename ? pSSM->pszFilename : "<remote-machine>"));
     
    45344534            ssmR3LiveControlEmit(pSSM, lrdPct, SSM_PASS_FINAL);
    45354535            pSSM->uPercent =  uPct;
    4536             pSSM->pfnProgress(pSSM->pVM, uPct, pSSM->pvUser);
     4536            pSSM->pfnProgress(pSSM->pVM->pUVM, uPct, pSSM->pvUser);
    45374537        }
    45384538    }
     
    47344734     */
    47354735    if (pSSM->pfnProgress)
    4736         pSSM->pfnProgress(pVM, pSSM->uPercentPrepare + pSSM->uPercentLive - 1, pSSM->pvUser);
     4736        pSSM->pfnProgress(pVM->pUVM, pSSM->uPercentPrepare + pSSM->uPercentLive - 1, pSSM->pvUser);
    47374737    pSSM->uPercent = pSSM->uPercentPrepare + pSSM->uPercentLive;
    47384738
     
    51065106                ssmR3LiveControlEmit(pSSM, lrdPct, uPass);
    51075107                pSSM->uPercent = uPct;
    5108                 pSSM->pfnProgress(pVM, uPct, pSSM->pvUser);
     5108                pSSM->pfnProgress(pVM->pUVM, uPct, pSSM->pvUser);
    51095109            }
    51105110        }
     
    53705370     */
    53715371    if (pSSM->pfnProgress)
    5372         pSSM->pfnProgress(pVM, 2, pSSM->pvUser);
     5372        pSSM->pfnProgress(pVM->pUVM, 2, pSSM->pvUser);
    53735373    pSSM->uPercent = 2;
    53745374
     
    83318331
    83328332        if (pfnProgress)
    8333             pfnProgress(pVM, Handle.uPercent, pvProgressUser);
     8333            pfnProgress(pVM->pUVM, Handle.uPercent, pvProgressUser);
    83348334
    83358335        /*
     
    83848384        /* end of prepare % */
    83858385        if (pfnProgress)
    8386             pfnProgress(pVM, Handle.uPercentPrepare - 1, pvProgressUser);
     8386            pfnProgress(pVM->pUVM, Handle.uPercentPrepare - 1, pvProgressUser);
    83878387        Handle.uPercent      = Handle.uPercentPrepare;
    83888388        Handle.cbEstTotal    = Handle.u.Read.cbLoadFile;
     
    84588458        /* progress */
    84598459        if (pfnProgress)
    8460             pfnProgress(pVM, 99, pvProgressUser);
     8460            pfnProgress(pVM->pUVM, 99, pvProgressUser);
    84618461
    84628462        ssmR3SetCancellable(pVM, &Handle, false);
     
    84728472        /* progress */
    84738473        if (pfnProgress)
    8474             pfnProgress(pVM, 100, pvProgressUser);
     8474            pfnProgress(pVM->pUVM, 100, pvProgressUser);
    84758475        Log(("SSM: Load of '%s' completed!\n", pszFilename));
    84768476    }
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r44347 r44393  
    31993199    for (PVMATSTATE pCur = pUVM->vm.s.pAtState; pCur; pCur = pCur->pNext)
    32003200    {
    3201         pCur->pfnAtState(pVM, enmStateNew, enmStateOld, pCur->pvUser);
     3201        pCur->pfnAtState(pUVM, enmStateNew, enmStateOld, pCur->pvUser);
    32023202        if (    enmStateNew     != VMSTATE_DESTROYING
    32033203            &&  pVM->enmVMState == VMSTATE_DESTROYING)
     
    36363636    va_list va;
    36373637    va_start(va, pszFormat);
    3638     pCur->pfnAtError(pVM, pCur->pvUser, rc, RT_SRC_POS_ARGS, pszFormat, va);
     3638    pCur->pfnAtError(pVM->pUVM, pCur->pvUser, rc, RT_SRC_POS_ARGS, pszFormat, va);
    36393639    va_end(va);
    36403640}
     
    37753775        va_list va2;
    37763776        va_copy(va2, *pArgs);
    3777         pCur->pfnAtError(pUVM->pVM, pCur->pvUser, rc, RT_SRC_POS_ARGS, pszFormat, va2);
     3777        pCur->pfnAtError(pUVM, pCur->pvUser, rc, RT_SRC_POS_ARGS, pszFormat, va2);
    37783778        va_end(va2);
    37793779        fCalledSomeone = true;
     
    39463946{
    39473947    LogRel(("VM: Raising runtime error '%s' (fFlags=%#x)\n", pszErrorId, fFlags));
     3948    PUVM pUVM = pVM->pUVM;
    39483949
    39493950    /*
     
    39553956                                vmR3SetRuntimeErrorChangeState, NULL);
    39563957    else if (fFlags & VMSETRTERR_FLAGS_SUSPEND)
    3957         rc = VMR3Suspend(pVM->pUVM);
     3958        rc = VMR3Suspend(pUVM);
    39583959    else
    39593960        rc = VINF_SUCCESS;
     
    39623963     * Do the callback round.
    39633964     */
    3964     PUVM pUVM = pVM->pUVM;
    39653965    RTCritSectEnter(&pUVM->vm.s.AtErrorCritSect);
    39663966    ASMAtomicIncU32(&pUVM->vm.s.cRuntimeErrors);
     
    39693969        va_list va;
    39703970        va_copy(va, *pVa);
    3971         pCur->pfnAtRuntimeError(pVM, pCur->pvUser, fFlags, pszErrorId, pszFormat, va);
     3971        pCur->pfnAtRuntimeError(pUVM, pCur->pvUser, fFlags, pszErrorId, pszFormat, va);
    39723972        va_end(va);
    39733973    }
  • trunk/src/VBox/VMM/testcase/tstVMREQ.cpp

    r44347 r44393  
    4949 * Testings va_list passing in VMSetRuntimeError.
    5050 */
    51 static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
    52 {
    53     NOREF(pVM);
     51static DECLCALLBACK(void) MyAtRuntimeError(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va)
     52{
     53    NOREF(pUVM);
    5454    if (strcmp((const char *)pvUser, "user argument"))
    5555    {
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