VirtualBox

Changeset 26350 in vbox


Ignore:
Timestamp:
Feb 9, 2010 9:21:38 AM (15 years ago)
Author:
vboxsync
Message:

Removed the balloon interface from Main's VMM device. Directly call PGMR3PhysFreeRamPages in VMMDev.

Location:
trunk
Files:
3 edited

Legend:

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

    r26300 r26350  
    20822082    DECLR3CALLBACKMEMBER(int, pfnReportStatistics,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestStatistics *pGuestStats));
    20832083
    2084     /**
    2085      * Inflate or deflate the memory balloon
    2086      *
    2087      * @returns VBox status code.
    2088      * @param   pInterface          Pointer to this interface.
    2089      * @param   fInflate            Inflate or deflate
    2090      * @param   cPages              Number of physical pages (must be 256 as we allocate in 1 MB chunks)
    2091      * @param   aPhysPage           Array of physical page addresses
    2092      * @thread  The emulation thread.
    2093      */
    2094     DECLR3CALLBACKMEMBER(int, pfnChangeMemoryBalloon, (PPDMIVMMDEVCONNECTOR pInterface, bool fInflate, uint32_t cPages, RTGCPHYS *aPhysPage));
    2095 
    20962084} PDMIVMMDEVCONNECTOR;
    20972085/** PDMIVMMDEVCONNECTOR interface ID. */
    2098 #define PDMIVMMDEVCONNECTOR_IID                 "38b96194-ee83-489e-b92e-73ee28a29439"
     2086#define PDMIVMMDEVCONNECTOR_IID                 "5c35e324-2b02-49b7-a613-119fbf3320a9"
    20992087
    21002088
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r26295 r26350  
    13871387            else
    13881388            {
    1389                 pRequestHeader->rc = pThis->pDrv->pfnChangeMemoryBalloon(pThis->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage);
     1389                if (memBalloonChange->fInflate)
     1390                    pRequestHeader->rc = PGMR3PhysFreeRamPages(PDMDevHlpGetVM(pDevIns), memBalloonChange->cPages, memBalloonChange->aPhysPage);
     1391                else
     1392                    pRequestHeader->rc = VINF_SUCCESS;      /* deflating the balloon doesn't require any action; when the reacquired memory is touched, it will be paged back in. */
    13901393            }
    13911394            break;
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r26295 r26350  
    512512        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_SampleNumber, sample+1);
    513513
    514     return VINF_SUCCESS;
    515 }
    516 
    517 /**
    518  * Inflate or deflate the memory balloon
    519  *
    520  * @returns VBox status code.
    521  * @param   pInterface          Pointer to this interface.
    522  * @param   fInflate            Inflate or deflate
    523  * @param   cPages              Number of physical pages (must be 256 as we allocate in 1 MB chunks)
    524  * @param   aPhysPage           Array of physical page addresses
    525  * @thread  The emulation thread.
    526  */
    527 DECLCALLBACK(int) vmmdevChangeMemoryBalloon(PPDMIVMMDEVCONNECTOR pInterface, bool fInflate, uint32_t cPages, RTGCPHYS *aPhysPage)
    528 {
    529     if (    cPages != VMMDEV_MEMORY_BALLOON_CHUNK_PAGES
    530         ||  !aPhysPage)
    531         return VERR_INVALID_PARAMETER;
    532 
    533     Log(("vmmdevChangeMemoryBalloon @todo\n"));
    534514    return VINF_SUCCESS;
    535515}
     
    737717    pData->Connector.pfnReportStatistics              = vmmdevReportStatistics;
    738718    pData->Connector.pfnQueryStatisticsInterval       = vmmdevQueryStatisticsInterval;
    739     pData->Connector.pfnChangeMemoryBalloon           = vmmdevChangeMemoryBalloon;
    740719
    741720#ifdef VBOX_WITH_HGCM
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