VirtualBox

Changeset 26295 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Feb 5, 2010 2:36:51 PM (15 years ago)
Author:
vboxsync
Message:

Backed out r57393

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r26290 r26295  
    8282        mMemoryBalloonSize = 0;                     /* Default is no ballooning */
    8383
     84    ULONG aStatUpdateInterval;
     85    ret = mParent->machine()->COMGETTER(StatisticsUpdateInterval)(&aStatUpdateInterval);
     86    if (ret == S_OK)
     87        mStatUpdateInterval = aStatUpdateInterval;
     88    else
     89        mStatUpdateInterval = 0;                    /* Default is not to report guest statistics at all */
     90
    8491    /* invalidate all stats */
    8592    for (int i=0;i<GuestStatisticType_MaxVal;i++)
     
    218225}
    219226
     227STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval) (ULONG *aUpdateInterval)
     228{
     229    CheckComArgOutPointerValid(aUpdateInterval);
     230
     231    AutoCaller autoCaller(this);
     232    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     233
     234    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     235
     236    *aUpdateInterval = mStatUpdateInterval;
     237
     238    return S_OK;
     239}
     240
     241STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval) (ULONG aUpdateInterval)
     242{
     243    AutoCaller autoCaller(this);
     244    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     245
     246    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     247
     248    HRESULT ret = mParent->machine()->COMSETTER(StatisticsUpdateInterval)(aUpdateInterval);
     249    if (ret == S_OK)
     250    {
     251        mStatUpdateInterval = aUpdateInterval;
     252        /* forward the information to the VMM device */
     253        VMMDev *vmmDev = mParent->getVMMDev();
     254        if (vmmDev)
     255            vmmDev->getVMMDevPort()->pfnSetStatisticsInterval(vmmDev->getVMMDevPort(), aUpdateInterval);
     256    }
     257
     258    return ret;
     259}
    220260
    221261STDMETHODIMP Guest::SetCredentials(IN_BSTR aUserName, IN_BSTR aPassword,
  • trunk/src/VBox/Main/MachineImpl.cpp

    r26290 r26295  
    157157    mCPUHotPlugEnabled = false;
    158158    mMemoryBalloonSize = 0;
     159    mStatisticsUpdateInterval = 0;
    159160    mVRAMSize = 8;
    160161    mAccelerate3DEnabled = false;
     
    11581159    return S_OK;
    11591160}
     1161
     1162/** @todo this method should not be public */
     1163STDMETHODIMP Machine::COMGETTER(StatisticsUpdateInterval) (ULONG *statisticsUpdateInterval)
     1164{
     1165    if (!statisticsUpdateInterval)
     1166        return E_POINTER;
     1167
     1168    AutoCaller autoCaller(this);
     1169    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1170
     1171    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     1172
     1173    *statisticsUpdateInterval = mHWData->mStatisticsUpdateInterval;
     1174
     1175    return S_OK;
     1176}
     1177
     1178/** @todo this method should not be public */
     1179STDMETHODIMP Machine::COMSETTER(StatisticsUpdateInterval) (ULONG statisticsUpdateInterval)
     1180{
     1181    AutoCaller autoCaller(this);
     1182    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1183
     1184    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     1185
     1186    HRESULT rc = checkStateDependency(MutableStateDep);
     1187    if (FAILED(rc)) return rc;
     1188
     1189    setModified(IsModified_MachineData);
     1190    mHWData.backup();
     1191    mHWData->mStatisticsUpdateInterval = statisticsUpdateInterval;
     1192
     1193    return S_OK;
     1194}
     1195
    11601196
    11611197STDMETHODIMP Machine::COMGETTER(Accelerate3DEnabled)(BOOL *enabled)
     
    62366272        // guest settings
    62376273        mHWData->mMemoryBalloonSize = data.ulMemoryBalloonSize;
     6274        mHWData->mStatisticsUpdateInterval = data.ulStatisticsUpdateInterval;
    62386275
    62396276#ifdef VBOX_WITH_GUEST_PROPS
     
    72697306        /* Guest */
    72707307        data.ulMemoryBalloonSize = mHWData->mMemoryBalloonSize;
     7308        data.ulStatisticsUpdateInterval = mHWData->mStatisticsUpdateInterval;
    72717309
    72727310        // guest properties
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r26290 r26295  
    403403}
    404404
     405/**
     406 * Request the statistics interval
     407 *
     408 * @returns VBox status code.
     409 * @param   pInterface          Pointer to this interface.
     410 * @param   pulInterval         Pointer to interval in seconds
     411 * @thread  The emulation thread.
     412 */
     413DECLCALLBACK(int) vmmdevQueryStatisticsInterval(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pulInterval)
     414{
     415    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     416    ULONG          val = 0;
     417
     418    if (!pulInterval)
     419        return VERR_INVALID_POINTER;
     420
     421    /* store that information in IGuest */
     422    Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
     423    Assert(guest);
     424    if (!guest)
     425        return VERR_INVALID_PARAMETER; /** @todo wrong error */
     426
     427    guest->COMGETTER(StatisticsUpdateInterval)(&val);
     428    *pulInterval = val;
     429    return VINF_SUCCESS;
     430}
    405431
    406432/**
     
    710736    pData->Connector.pfnQueryVisibleRegion            = vmmdevQueryVisibleRegion;
    711737    pData->Connector.pfnReportStatistics              = vmmdevReportStatistics;
     738    pData->Connector.pfnQueryStatisticsInterval       = vmmdevQueryStatisticsInterval;
    712739    pData->Connector.pfnChangeMemoryBalloon           = vmmdevChangeMemoryBalloon;
    713740
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r26290 r26295  
    43714371    </attribute>
    43724372
     4373    <attribute name="statisticsUpdateInterval" type="unsigned long">
     4374      <desc>Initial interval to update guest statistics in seconds.</desc>
     4375    </attribute>
     4376
    43734377    <attribute name="VRAMSize" type="unsigned long">
    43744378      <desc>Video memory size in megabytes.</desc>
     
    83078311    <attribute name="memoryBalloonSize" type="unsigned long">
    83088312      <desc>Guest system memory balloon size in megabytes.</desc>
     8313    </attribute>
     8314
     8315    <attribute name="statisticsUpdateInterval" type="unsigned long">
     8316      <desc>Interval to update guest statistics in seconds.</desc>
    83098317    </attribute>
    83108318
  • trunk/src/VBox/Main/include/GuestImpl.h

    r26290 r26295  
    6565    STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
    6666    STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
     67    STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
     68    STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
    6769
    6870    // IGuest methods
     
    99101
    100102    ULONG mMemoryBalloonSize;
     103    ULONG mStatUpdateInterval;
    101104
    102105    ULONG mCurrentGuestStat[GuestStatisticType_MaxVal];
  • trunk/src/VBox/Main/include/MachineImpl.h

    r26290 r26295  
    269269        ULONG          mMemorySize;
    270270        ULONG          mMemoryBalloonSize;
     271        ULONG          mStatisticsUpdateInterval;
    271272        ULONG          mVRAMSize;
    272273        ULONG          mMonitorCount;
     
    375376    STDMETHOD(COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize);
    376377    STDMETHOD(COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize);
     378    STDMETHOD(COMGETTER(StatisticsUpdateInterval))(ULONG *statisticsUpdateInterval);
     379    STDMETHOD(COMSETTER(StatisticsUpdateInterval))(ULONG statisticsUpdateInterval);
    377380    STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize);
    378381    STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
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