VirtualBox

Changeset 4532 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2007 1:13:07 PM (17 years ago)
Author:
vboxsync
Message:

Memory balloon size change updates

Location:
trunk
Files:
4 edited

Legend:

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

    r4524 r4532  
    147147    VMMDevReq_GetMemBalloonChangeRequest = 111,
    148148    VMMDevReq_GetStatisticsChangeRequest = 112,
     149    VMMDevReq_ChangeMemBalloon           = 113,
    149150    VMMDevReq_LogString                  = 200,
    150151    VMMDevReq_SizeHack                   = 0x7fffffff
     
    404405    uint32_t            eventAck;
    405406} VMMDevGetMemBalloonChangeRequest;
     407
     408/** inflate/deflate memory balloon structure */
     409typedef struct
     410{
     411    /** header */
     412    VMMDevRequestHeader header;
     413    uint32_t            cPages;
     414    uint32_t            fInflate;       /* true = inflate, false = defalte */
     415    RTGCPHYS            aPhysPage[1];   /* variable size */
     416} VMMDevChangeMemBalloon;
    406417
    407418/** guest statistics interval change request structure */
     
    13191330        case VMMDevReq_GetStatisticsChangeRequest:
    13201331            return sizeof(VMMDevGetStatisticsChangeRequest);
     1332        case VMMDevReq_ChangeMemBalloon:
     1333            return sizeof(VMMDevChangeMemBalloon);
    13211334        case VMMDevReq_LogString:
    13221335            return sizeof(VMMDevReqLogString);
  • trunk/include/VBox/pdmifs.h

    r4524 r4532  
    15931593    DECLR3CALLBACKMEMBER(int, pfnReportStatistics,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestStatistics *pGuestStats));
    15941594
     1595    /**
     1596     * Inflate or deflate the memory balloon
     1597     *
     1598     * @returns VBox status code.
     1599     * @param   pInterface          Pointer to this interface.
     1600     * @param   fInflate            Inflate or deflate
     1601     * @param   cPages              Number of physical pages (must be 256 as we allocate in 1 MB chunks)
     1602     * @param   aPhysPage           Array of physical page addresses
     1603     * @thread  The emulation thread.
     1604     */
     1605    DECLR3CALLBACKMEMBER(int, pfnChangeMemoryBalloon, (PPDMIVMMDEVCONNECTOR pInterface, bool fInflate, uint32_t cPages, RTGCPHYS *aPhysPage));
     1606
    15951607} PDMIVMMDEVCONNECTOR;
    15961608
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r4524 r4532  
    12011201
    12021202                requestHeader->rc = VINF_SUCCESS;
     1203            }
     1204            break;
     1205        }
     1206
     1207        case VMMDevReq_ChangeMemBalloon:
     1208        {
     1209            VMMDevChangeMemBalloon *memBalloonChange = (VMMDevChangeMemBalloon*)requestHeader;
     1210
     1211            Log(("VMMDevReq_ChangeMemBalloon\n"));
     1212            if (    requestHeader->size < sizeof(VMMDevChangeMemBalloon)
     1213                ||  requestHeader->size != RT_OFFSETOF(VMMDevChangeMemBalloon, aPhysPage[memBalloonChange->cPages]))
     1214            {
     1215                AssertFailed();
     1216                requestHeader->rc = VERR_INVALID_PARAMETER;
     1217            }
     1218            else
     1219            {
     1220                requestHeader->rc = pData->pDrv->pfnChangeMemoryBalloon(pData->pDrv, !!memBalloonChange->fInflate, memBalloonChange->cPages, memBalloonChange->aPhysPage);
    12031221            }
    12041222            break;
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r4513 r4532  
    425425        guest->SetStatistic(GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize);
    426426
     427    return VINF_SUCCESS;
     428}
     429
     430/**
     431 * Inflate or deflate the memory balloon
     432 *
     433 * @returns VBox status code.
     434 * @param   pInterface          Pointer to this interface.
     435 * @param   fInflate            Inflate or deflate
     436 * @param   cPages              Number of physical pages (must be 256 as we allocate in 1 MB chunks)
     437 * @param   aPhysPage           Array of physical page addresses
     438 * @thread  The emulation thread.
     439 */
     440DECLCALLBACK(int) vmmdevChangeMemoryBalloon(PPDMIVMMDEVCONNECTOR pInterface, bool fInflate, uint32_t cPages, RTGCPHYS *aPhysPage)
     441{
     442    if (    cPages != 256
     443        ||  !aPhysPage)
     444        return VERR_INVALID_PARAMETER;
     445
     446    AssertMsgFailed(("vmmdevChangeMemoryBalloon @todo\n"));
    427447    return VINF_SUCCESS;
    428448}
     
    618638    pData->Connector.pfnReportStatistics              = vmmdevReportStatistics;
    619639    pData->Connector.pfnQueryStatisticsInterval       = vmmdevQueryStatisticsInterval;
     640    pData->Connector.pfnChangeMemoryBalloon           = vmmdevChangeMemoryBalloon;
    620641
    621642#ifdef VBOX_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