VirtualBox

Changeset 28051 in vbox


Ignore:
Timestamp:
Apr 7, 2010 2:09:14 PM (15 years ago)
Author:
vboxsync
Message:

Another attempt to initialize the balloon correct during startup

Location:
trunk
Files:
4 edited

Legend:

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

    r27965 r28051  
    21972197    DECLR3CALLBACKMEMBER(int, pfnReportStatistics,(PPDMIVMMDEVCONNECTOR pInterface, struct VBoxGuestStatistics *pGuestStats));
    21982198
     2199    /**
     2200     * Query the current balloon size
     2201     *
     2202     * @returns VBox status code.
     2203     * @param   pInterface          Pointer to this interface.
     2204     * @param   pcbBalloon          Balloon size
     2205     * @thread  The emulation thread.
     2206     */
     2207    DECLR3CALLBACKMEMBER(int, pfnQueryBalloonSize,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcbBalloon));
     2208
    21992209} PDMIVMMDEVCONNECTOR;
    22002210/** PDMIVMMDEVCONNECTOR interface ID. */
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r27970 r28051  
    27642764        }
    27652765#endif
     2766        /* Query the initial balloon size. */
     2767        rc = pThis->pDrv->pfnQueryBalloonSize(pThis->pDrv, &pThis->u32MemoryBalloonSize);
     2768        AssertRC(rc);
     2769        Log(("Initial balloon size %x\n", pThis->u32MemoryBalloonSize));
    27662770    }
    27672771    else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
  • trunk/src/VBox/Main/GuestImpl.cpp

    r28049 r28051  
    8484    HRESULT ret = mParent->machine()->COMGETTER(MemoryBalloonSize)(&aMemoryBalloonSize);
    8585    if (ret == S_OK)
    86     {
    8786        mMemoryBalloonSize = aMemoryBalloonSize;
    88 
    89         if (mMemoryBalloonSize)
    90         {
    91             /* forward the information to the VMM device */
    92             VMMDev *vmmDev = mParent->getVMMDev();
    93             if (vmmDev)
    94                 vmmDev->getVMMDevPort()->pfnSetMemoryBalloon(vmmDev->getVMMDevPort(), aMemoryBalloonSize);
    95         }
    96     }
    9787    else
    9888        mMemoryBalloonSize = 0;                     /* Default is no ballooning */
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r27971 r28051  
    433433    guest->COMGETTER(StatisticsUpdateInterval)(&val);
    434434    *pulInterval = val;
     435    return VINF_SUCCESS;
     436}
     437
     438/**
     439 * Query the current balloon size
     440 *
     441 * @returns VBox status code.
     442 * @param   pInterface          Pointer to this interface.
     443 * @param   pcbBalloon          Balloon size
     444 * @thread  The emulation thread.
     445 */
     446DECLCALLBACK(int) vmmdevQueryBalloonSize(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcbBalloon)
     447{
     448    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     449    ULONG          val = 0;
     450
     451    if (!pcbBalloon)
     452        return VERR_INVALID_POINTER;
     453
     454    /* store that information in IGuest */
     455    Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
     456    Assert(guest);
     457    if (!guest)
     458        return VERR_INVALID_PARAMETER; /** @todo wrong error */
     459
     460    guest->COMGETTER(MemoryBalloonSize)(&val);
     461    *pcbBalloon = val;
    435462    return VINF_SUCCESS;
    436463}
     
    691718    pData->Connector.pfnReportStatistics              = vmmdevReportStatistics;
    692719    pData->Connector.pfnQueryStatisticsInterval       = vmmdevQueryStatisticsInterval;
     720    pData->Connector.pfnQueryBalloonSize              = vmmdevQueryBalloonSize;
    693721
    694722#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