VirtualBox

Changeset 30650 in vbox


Ignore:
Timestamp:
Jul 6, 2010 9:30:16 AM (15 years ago)
Author:
vboxsync
Message:

Attempt nr 2 to reinit page fusion after VM restore

Location:
trunk
Files:
4 edited

Legend:

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

    r30646 r30650  
    479479/** Inconsistent local and global registration records. */
    480480#define VERR_PGM_SHARED_MODULE_REGISTRATION_INCONSISTENCY (-1650)
    481 /** No registered modules. */
    482 #define VINF_PGM_SHARED_MODULE_NONE_REGISTERED  (1651)
     481/** First shared module check. */
     482#define VINF_PGM_SHARED_MODULE_FIRST_CHECK      (1651)
    483483/** @} */
    484484
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp

    r30648 r30650  
    483483    }
    484484
     485    bool fFirstCheck = (pKnownModuleTree == NULL);
     486
    485487    /* Delete leftover modules in the old tree. */
    486488    RTAvlPVDestroy(&pKnownModuleTree, VBoxServicePageSharingEmptyTreeCallback, NULL);
     
    488490    /* Check all registered modules. */
    489491    int rc = VbglR3CheckSharedModules();
    490     if (rc == VINF_PGM_SHARED_MODULE_NONE_REGISTERED)
     492    if (    rc == VINF_PGM_SHARED_MODULE_FIRST_CHECK
     493        &&  !fFirstCheck)
    491494    {
    492495        bool fUnregister = false;
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r30646 r30650  
    41694169
    41704170        Log(("GMMR0CheckSharedModules\n"));
    4171         if (pGVM->gmm.s.pSharedModuleTree != NULL)
    4172         {
    4173             Info.pGVM     = pGVM;
    4174             Info.idCpu    = pVCpu->idCpu;
    4175 
    4176             RTAvlGCPtrDoWithAll(&pGVM->gmm.s.pSharedModuleTree, true /* fFromLeft */, gmmR0CheckSharedModule, &Info);
     4171        Info.pGVM     = pGVM;
     4172        Info.idCpu    = pVCpu->idCpu;
     4173
     4174        RTAvlGCPtrDoWithAll(&pGVM->gmm.s.pSharedModuleTree, true /* fFromLeft */, gmmR0CheckSharedModule, &Info);
     4175
     4176        if (pGVM->gmm.s.fFirstCheckSharedModule)
     4177        {
     4178            /* To make sure the guest additions can detect a VM restore as that needs a reregistration of all modules. */
     4179            rc = VINF_PGM_SHARED_MODULE_FIRST_CHECK;
     4180            pGVM->gmm.s.fFirstCheckSharedModule = false;
     4181        }
     4182        else
    41774183            rc = VINF_SUCCESS;
    4178         }
    4179         else
    4180             rc = VINF_PGM_SHARED_MODULE_NONE_REGISTERED;
    41814184
    41824185        Log(("GMMR0CheckSharedModules done!\n"));
  • trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h

    r30027 r30650  
    107107    bool                fSharedPagingEnabled;
    108108
     109    /** First GMMR0CheckSharedModules call? */
     110    bool                fFirstCheckSharedModule;
     111
    109112    /** Whether the VM is allowed to allocate memory or not.
    110113     * This is used when the reservation update request fails or when the VM has
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