VirtualBox

Changeset 93449 in vbox for trunk


Ignore:
Timestamp:
Jan 26, 2022 7:57:06 PM (3 years ago)
Author:
vboxsync
Message:

Main,ExtPacks: Don't like with the VMM anymore, use the function table. bugref:10074

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r93438 r93449  
    73547354   TEMPLATE_VBoxR3ExtPack_LIBS = \
    73557355        $(TEMPLATE_LIBS_VBOXR3) \
    7356         $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_LIB), $(VBOX_LIB_VMM_LAZY)) \
    73577356        $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_LIB)
    73587357  else
    73597358   TEMPLATE_VBoxR3ExtPack_LIBS = \
    73607359        $(TEMPLATE_LIBS_VBOXR3) \
    7361         $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_DLL), $(VBOX_LIB_VMM_LAZY)) \
    73627360        $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_DLL)
    73637361  endif
     
    73657363  TEMPLATE_VBoxR3ExtPack_LIBS = \
    73667364        $(TEMPLATE_LIBS_VBOXR3) \
    7367         $(LIB_RUNTIME) \
    7368         $(VBOX_LIB_VMM_LAZY)
     7365        $(LIB_RUNTIME)
    73697366 endif
    73707367 ifeq ($(KBUILD_TARGET),darwin)
     
    73857382   TEMPLATE_VBoxR3ExtPackApi_LIBS = \
    73867383        $(TEMPLATE_LIBS_VBOXR3) \
    7387         $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_LIB), $(VBOX_LIB_VMM_LAZY)) \
    73887384        $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_LIB)
    73897385  else
    73907386   TEMPLATE_VBoxR3ExtPackApi_LIBS = \
    73917387        $(TEMPLATE_LIBS_VBOXR3) \
    7392         $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_DLL), $(VBOX_LIB_VMM_LAZY)) \
    73937388        $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_DLL)
    73947389  endif
     
    73967391  TEMPLATE_VBoxR3ExtPackApi_LIBS = \
    73977392        $(TEMPLATE_LIBS_VBOXR3) \
    7398         $(LIB_RUNTIME) \
    7399         $(VBOX_LIB_VMM_LAZY)
     7393        $(LIB_RUNTIME)
    74007394 endif
    74017395 ifeq ($(KBUILD_TARGET),darwin)
     
    76617655        $(VBOX_LIBS_QT) \
    76627656        $(LIB_RUNTIME) \
    7663         $(VBOX_LIB_VMM_LAZY) \
    76647657        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/vcruntime.lib \
    76657658        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
     
    76767669        $(VBOX_LIBS_QT) \
    76777670        $(LIB_RUNTIME) \
    7678         $(VBOX_LIB_VMM_LAZY) \
    76797671        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
    76807672        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
     
    77307722  TEMPLATE_VBOXQTGUIEXE_LIBS = \
    77317723        $(VBOX_LIBS_QT) \
    7732         $(LIB_RUNTIME) \
    7733         $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
    7734         $(VBOX_LIB_VMM_LAZY)
     7724        $(LIB_RUNTIME)
    77357725
    77367726  ifeq ($(KBUILD_TARGET),linux)
  • trunk/include/VBox/ExtPack/ExtPack.h

    r93115 r93449  
    536536     * @param   pConsole    The console interface.
    537537     * @param   pVM         The cross context VM structure.
    538      */
    539     DECLCALLBACKMEMBER(int, pfnVMConfigureVMM,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM));
     538     * @param   pVMM        The VMM function table.
     539     */
     540    DECLCALLBACKMEMBER(int, pfnVMConfigureVMM,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole,
     541                                               PVM pVM, PCVMMR3VTABLE pVMM));
    540542
    541543    /**
     
    546548     * @param   pConsole    The console interface.
    547549     * @param   pVM         The cross context VM structure.
    548      */
    549     DECLCALLBACKMEMBER(int, pfnVMPowerOn,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM));
     550     * @param   pVMM        The VMM function table.
     551     */
     552    DECLCALLBACKMEMBER(int, pfnVMPowerOn,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole,
     553                                          PVM pVM, PCVMMR3VTABLE pVMM));
    550554
    551555    /**
     
    555559     * @param   pConsole    The console interface.
    556560     * @param   pVM         The cross context VM structure. Can be NULL.
    557      */
    558     DECLCALLBACKMEMBER(void, pfnVMPowerOff,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM));
     561     * @param   pVMM        The VMM function table.
     562     */
     563    DECLCALLBACKMEMBER(void, pfnVMPowerOff,(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole,
     564                                            PVM pVM, PCVMMR3VTABLE pVMM));
    559565
    560566    /**
     
    581587} VBOXEXTPACKVMREG;
    582588/** Current version of the VBOXEXTPACKVMREG structure.  */
    583 #define VBOXEXTPACKVMREG_VERSION      RT_MAKE_U32(0, 3)
     589#define VBOXEXTPACKVMREG_VERSION      RT_MAKE_U32(1, 0)
    584590
    585591
  • trunk/src/VBox/Main/Makefile.kmk

    r93444 r93449  
    566566        nsl \
    567567        devinfo \
    568         socket \
    569         $(LIB_VMM)
     568        socket
    570569
    571570VBoxSVC_LIBS.win += \
  • trunk/src/VBox/Main/include/ExtPackManagerImpl.h

    r93115 r93449  
    125125#endif
    126126#ifdef VBOX_COM_INPROC
    127     bool        i_callVmConfigureVmmHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc);
    128     bool        i_callVmPowerOnHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc);
    129     bool        i_callVmPowerOffHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock);
     127    bool        i_callVmConfigureVmmHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM,
     128                                         AutoWriteLock *a_pLock, int *a_pvrc);
     129    bool        i_callVmPowerOnHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM, AutoWriteLock *a_pLock, int *a_pvrc);
     130    bool        i_callVmPowerOffHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM, AutoWriteLock *a_pLock);
    130131#endif
    131132    HRESULT     i_checkVrde(void);
     
    254255#endif
    255256#ifdef VBOX_COM_INPROC
    256     int         i_callAllVmConfigureVmmHooks(IConsole *a_pConsole, PVM a_pVM);
    257     int         i_callAllVmPowerOnHooks(IConsole *a_pConsole, PVM a_pVM);
    258     void        i_callAllVmPowerOffHooks(IConsole *a_pConsole, PVM a_pVM);
     257    int         i_callAllVmConfigureVmmHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM);
     258    int         i_callAllVmPowerOnHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM);
     259    void        i_callAllVmPowerOffHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM);
    259260#endif
    260261    HRESULT     i_checkVrdeExtPack(Utf8Str const *a_pstrExtPack);
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r93115 r93449  
    10331033
    10341034#ifdef VBOX_COM_INPROC
     1035
    10351036/**
    10361037 * Calls the pfnVMConfigureVMM hook.
    10371038 *
    10381039 * @returns true if we left the lock, false if we didn't.
    1039  * @param   a_pConsole          The console interface.
    1040  * @param   a_pVM               The VM handle.
    1041  * @param   a_pLock             The write lock held by the caller.
    1042  * @param   a_pvrc              Where to return the status code of the
    1043  *                              callback.  This is always set.  LogRel is
    1044  *                              called on if a failure status is returned.
    1045  */
    1046 bool ExtPack::i_callVmConfigureVmmHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc)
     1040 * @param   a_pConsole  The console interface.
     1041 * @param   a_pVM       The VM handle.
     1042 * @param   a_pVMM      The VMM function table.
     1043 * @param   a_pLock     The write lock held by the caller.
     1044 * @param   a_pvrc      Where to return the status code of the callback.  This
     1045 *                      is always set.  LogRel is called on if a failure status
     1046 *                      is returned.
     1047 */
     1048bool ExtPack::i_callVmConfigureVmmHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM, AutoWriteLock *a_pLock, int *a_pvrc)
    10471049{
    10481050    *a_pvrc = VINF_SUCCESS;
     
    10551057            ComPtr<ExtPack> ptrSelfRef = this;
    10561058            a_pLock->release();
    1057             int vrc = m->pReg->pfnVMConfigureVMM(m->pReg, a_pConsole, a_pVM);
     1059            int vrc = m->pReg->pfnVMConfigureVMM(m->pReg, a_pConsole, a_pVM, a_pVMM);
    10581060            *a_pvrc = vrc;
    10591061            a_pLock->acquire();
     
    10701072 *
    10711073 * @returns true if we left the lock, false if we didn't.
    1072  * @param   a_pConsole          The console interface.
    1073  * @param   a_pVM               The VM handle.
    1074  * @param   a_pLock             The write lock held by the caller.
    1075  * @param   a_pvrc              Where to return the status code of the
    1076  *                              callback.  This is always set.  LogRel is
    1077  *                              called on if a failure status is returned.
    1078  */
    1079 bool ExtPack::i_callVmPowerOnHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc)
     1074 * @param   a_pConsole  The console interface.
     1075 * @param   a_pVM       The VM handle.
     1076 * @param   a_pVMM      The VMM function table.
     1077 * @param   a_pLock     The write lock held by the caller.
     1078 * @param   a_pvrc      Where to return the status code of the callback.  This
     1079 *                      is always set.  LogRel is called on if a failure status
     1080 *                      is returned.
     1081 */
     1082bool ExtPack::i_callVmPowerOnHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM, AutoWriteLock *a_pLock, int *a_pvrc)
    10801083{
    10811084    *a_pvrc = VINF_SUCCESS;
     
    10881091            ComPtr<ExtPack> ptrSelfRef = this;
    10891092            a_pLock->release();
    1090             int vrc = m->pReg->pfnVMPowerOn(m->pReg, a_pConsole, a_pVM);
     1093            int vrc = m->pReg->pfnVMPowerOn(m->pReg, a_pConsole, a_pVM, a_pVMM);
    10911094            *a_pvrc = vrc;
    10921095            a_pLock->acquire();
     
    11031106 *
    11041107 * @returns true if we left the lock, false if we didn't.
    1105  * @param   a_pConsole          The console interface.
    1106  * @param   a_pVM               The VM handle.
    1107  * @param   a_pLock             The write lock held by the caller.
    1108  */
    1109 bool ExtPack::i_callVmPowerOffHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock)
     1108 * @param   a_pConsole  The console interface.
     1109 * @param   a_pVM       The VM handle.
     1110 * @param   a_pVMM      The VMM function table.
     1111 * @param   a_pLock     The write lock held by the caller.
     1112 */
     1113bool ExtPack::i_callVmPowerOffHook(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM, AutoWriteLock *a_pLock)
    11101114{
    11111115    if (   m != NULL
     
    11171121            ComPtr<ExtPack> ptrSelfRef = this;
    11181122            a_pLock->release();
    1119             m->pReg->pfnVMPowerOff(m->pReg, a_pConsole, a_pVM);
     1123            m->pReg->pfnVMPowerOff(m->pReg, a_pConsole, a_pVM, a_pVMM);
    11201124            a_pLock->acquire();
    11211125            return true;
     
    11241128    return false;
    11251129}
     1130
    11261131#endif /* VBOX_COM_INPROC */
    11271132
     
    33643369
    33653370#ifdef VBOX_COM_INPROC
     3371
    33663372/**
    33673373 * Calls the pfnVMConfigureVMM hook for all working extension packs.
     
    33693375 * @returns VBox status code.  Stops on the first failure, expecting the caller
    33703376 *          to signal this to the caller of the CFGM constructor.
    3371  * @param   a_pConsole          The console interface for the VM.
    3372  * @param   a_pVM               The VM handle.
    3373  */
    3374 int ExtPackManager::i_callAllVmConfigureVmmHooks(IConsole *a_pConsole, PVM a_pVM)
     3377 * @param   a_pConsole  The console interface for the VM.
     3378 * @param   a_pVM       The VM handle.
     3379 * @param   a_pVMM      The VMM function table.
     3380 */
     3381int ExtPackManager::i_callAllVmConfigureVmmHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM)
    33753382{
    33763383    AutoCaller autoCaller(this);
     
    33853392    {
    33863393        int vrc;
    3387         (*it)->i_callVmConfigureVmmHook(a_pConsole, a_pVM, &autoLock, &vrc);
     3394        (*it)->i_callVmConfigureVmmHook(a_pConsole, a_pVM, a_pVMM, &autoLock, &vrc);
    33883395        if (RT_FAILURE(vrc))
    33893396            return vrc;
     
    33983405 * @returns VBox status code.  Stops on the first failure, expecting the caller
    33993406 *          to not power on the VM.
    3400  * @param   a_pConsole          The console interface for the VM.
    3401  * @param   a_pVM               The VM handle.
    3402  */
    3403 int ExtPackManager::i_callAllVmPowerOnHooks(IConsole *a_pConsole, PVM a_pVM)
     3407 * @param   a_pConsole  The console interface for the VM.
     3408 * @param   a_pVM       The VM handle.
     3409 * @param   a_pVMM      The VMM function table.
     3410 */
     3411int ExtPackManager::i_callAllVmPowerOnHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM)
    34043412{
    34053413    AutoCaller autoCaller(this);
     
    34143422    {
    34153423        int vrc;
    3416         (*it)->i_callVmPowerOnHook(a_pConsole, a_pVM, &autoLock, &vrc);
     3424        (*it)->i_callVmPowerOnHook(a_pConsole, a_pVM, a_pVMM, &autoLock, &vrc);
    34173425        if (RT_FAILURE(vrc))
    34183426            return vrc;
     
    34253433 * Calls the pfnVMPowerOff hook for all working extension packs.
    34263434 *
    3427  * @param   a_pConsole          The console interface for the VM.
    3428  * @param   a_pVM               The VM handle. Can be NULL.
    3429  */
    3430 void ExtPackManager::i_callAllVmPowerOffHooks(IConsole *a_pConsole, PVM a_pVM)
     3435 * @param   a_pConsole  The console interface for the VM.
     3436 * @param   a_pVM       The VM handle. Can be NULL.
     3437 * @param   a_pVMM      The VMM function table.
     3438 */
     3439void ExtPackManager::i_callAllVmPowerOffHooks(IConsole *a_pConsole, PVM a_pVM, PCVMMR3VTABLE a_pVMM)
    34313440{
    34323441    AutoCaller autoCaller(this);
     
    34393448
    34403449    for (ExtPackList::iterator it = llExtPacks.begin(); it != llExtPacks.end(); ++it)
    3441         (*it)->i_callVmPowerOffHook(a_pConsole, a_pVM, &autoLock);
    3442 }
    3443 #endif
    3444 
     3450        (*it)->i_callVmPowerOffHook(a_pConsole, a_pVM, a_pVMM, &autoLock);
     3451}
     3452
     3453#endif /* VBOX_COM_INPROC */
    34453454
    34463455/**
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r93444 r93449  
    67876787    {
    67886788#ifdef VBOX_WITH_EXTPACK
    6789         vrc = mptrExtPackManager->i_callAllVmPowerOnHooks(this, ptrVM.vtable()->pfnVMR3GetVM(ptrVM.rawUVM()));
     6789        vrc = mptrExtPackManager->i_callAllVmPowerOnHooks(this, ptrVM.vtable()->pfnVMR3GetVM(ptrVM.rawUVM()), ptrVM.vtable());
    67906790#else
    67916791        vrc = VINF_SUCCESS;
     
    83888388        vrc = pVMM->pfnVMR3PowerOff(pUVM);
    83898389#ifdef VBOX_WITH_EXTPACK
    8390         mptrExtPackManager->i_callAllVmPowerOffHooks(this, pVMM->pfnVMR3GetVM(pUVM));
     8390        mptrExtPackManager->i_callAllVmPowerOffHooks(this, pVMM->pfnVMR3GetVM(pUVM), pVMM);
    83918391#endif
    83928392        alock.acquire();
     
    1049810498                            /* Start/Resume the VM execution */
    1049910499#ifdef VBOX_WITH_EXTPACK
    10500                             vrc = pConsole->mptrExtPackManager->i_callAllVmPowerOnHooks(pConsole, pVM);
     10500                            vrc = pConsole->mptrExtPackManager->i_callAllVmPowerOnHooks(pConsole, pVM, pVMM);
    1050110501#endif
    1050210502                            if (RT_SUCCESS(vrc))
     
    1051110511                        int vrc2 = pVMM->pfnVMR3PowerOff(pConsole->mpUVM); AssertLogRelRC(vrc2);
    1051210512#ifdef VBOX_WITH_EXTPACK
    10513                         pConsole->mptrExtPackManager->i_callAllVmPowerOffHooks(pConsole, pVM);
     10513                        pConsole->mptrExtPackManager->i_callAllVmPowerOffHooks(pConsole, pVM, pVMM);
    1051410514#endif
    1051510515                    }
     
    1052610526                        int vrc2 = pVMM->pfnVMR3PowerOff(pConsole->mpUVM); AssertLogRelRC(vrc2);
    1052710527#ifdef VBOX_WITH_EXTPACK
    10528                         pConsole->mptrExtPackManager->i_callAllVmPowerOffHooks(pConsole, pVM);
     10528                        pConsole->mptrExtPackManager->i_callAllVmPowerOffHooks(pConsole, pVM, pVMM);
    1052910529#endif
    1053010530                    }
     
    1053710537                    /* Power on the VM (i.e. start executing) */
    1053810538#ifdef VBOX_WITH_EXTPACK
    10539                     vrc = pConsole->mptrExtPackManager->i_callAllVmPowerOnHooks(pConsole, pVM);
     10539                    vrc = pConsole->mptrExtPackManager->i_callAllVmPowerOnHooks(pConsole, pVM, pVMM);
    1054010540#endif
    1054110541                    if (RT_SUCCESS(vrc))
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r93444 r93449  
    37163716    {
    37173717        pAlock->release();
    3718         rc = mptrExtPackManager->i_callAllVmConfigureVmmHooks(this, pVM);
     3718        rc = mptrExtPackManager->i_callAllVmConfigureVmmHooks(this, pVM, pVMM);
    37193719        pAlock->acquire();
    37203720    }
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