VirtualBox

Changeset 4318 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 23, 2007 3:32:58 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23848
Message:

Update interval for guest statistics

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

Legend:

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

    r4316 r4318  
    6666    autoInitSpan.setSucceeded();
    6767
     68    /* Default is a ten second update interval */
     69    mStatUpdateInterval = 10;
    6870    return S_OK;
    6971}
     
    169171STDMETHODIMP Guest::COMSETTER(MemoryBalloonSize) (ULONG aMemoryBalloonSize)
    170172{
     173    /** @todo fail if larger than physical memory */
     174
     175    AutoCaller autoCaller (this);
     176    CheckComRCReturnRC (autoCaller.rc());
     177
     178    AutoReaderLock alock (this);
     179
     180    mMemoryBalloonSize = aMemoryBalloonSize;
     181
     182    return S_OK;
     183}
     184
     185STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval) (ULONG *aUpdateInterval)
     186{
     187    if (!aUpdateInterval)
     188        return E_POINTER;
     189
     190    AutoCaller autoCaller (this);
     191    CheckComRCReturnRC (autoCaller.rc());
     192
     193    AutoReaderLock alock (this);
     194
     195    *aUpdateInterval = mStatUpdateInterval;
     196
     197    return S_OK;
     198}
     199
     200STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval) (ULONG aUpdateInterval)
     201{
     202    /* zero seconds is invalid */
     203    if (!aUpdateInterval)
     204        return E_INVALIDARG;
     205
     206    AutoCaller autoCaller (this);
     207    CheckComRCReturnRC (autoCaller.rc());
     208
     209    AutoReaderLock alock (this);
     210
     211    mStatUpdateInterval = aUpdateInterval;
     212
    171213    return S_OK;
    172214}
     
    199241}
    200242
    201 STDMETHODIMP Guest::GetGuestStatistic(GuestStatisticType_T statistic, ULONG *aStatVal)
     243STDMETHODIMP Guest::GetStatistic(GuestStatisticType_T statistic, ULONG *aStatVal)
    202244{
    203245    if (!aStatVal)
     
    222264}
    223265
    224 STDMETHODIMP Guest::SetGuestStatistic(GuestStatisticType_T statistic, ULONG aStatVal)
     266STDMETHODIMP Guest::SetStatistic(GuestStatisticType_T statistic, ULONG aStatVal)
    225267{
    226268    switch(statistic)
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r4316 r4318  
    43574357  <interface
    43584358     name="IGuest" extends="$unknown"
    4359      uuid="c7dca803-9ff0-4819-aa3c-d0f191d3798b"
     4359     uuid="5d54a565-813c-42a0-a81a-e31779e03186"
    43604360     wsmap="suppress"
    43614361     >
     
    44114411    </attribute>
    44124412
     4413    <attribute name="statisticsUpdateInterval" type="unsigned long">
     4414      <desc>Interval to update guest statistics in seconds.</desc>
     4415    </attribute>
     4416
    44134417    <method name="setCredentials">
    44144418      <desc>
     
    44374441    </method>
    44384442
    4439     <method name="getGuestStatistic">
     4443    <method name="getStatistic">
    44404444      <desc>
    44414445        Query specified guest statistics as reported by the VirtualBox Additions.
  • trunk/src/VBox/Main/include/GuestImpl.h

    r4316 r4318  
    5858    STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
    5959    STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
     60    STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
     61    STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
    6062
    6163    // IGuest methods
    6264    STDMETHOD(SetCredentials)(INPTR BSTR aUserName, INPTR BSTR aPassword,
    6365                              INPTR BSTR aDomain, BOOL aAllowInteractiveLogon);
    64     STDMETHOD(GetGuestStatistic)(GuestStatisticType_T statistic, ULONG *aStatVal);
     66    STDMETHOD(GetStatistic)(GuestStatisticType_T statistic, ULONG *aStatVal);
    6567
    6668    // public methods that are not in IDL
     
    6971    void setSupportsSeamless (BOOL aSupportsSeamless);
    7072
    71     STDMETHOD(SetGuestStatistic)(GuestStatisticType_T statistic, ULONG aStatVal);
     73    STDMETHOD(SetStatistic)(GuestStatisticType_T statistic, ULONG aStatVal);
    7274
    7375    // for VirtualBoxSupportErrorInfoImpl
     
    8789
    8890    ULONG mMemoryBalloonSize;
     91    ULONG mStatUpdateInterval;
    8992
    9093    ComObjPtr <Console, ComWeakRef> mParent;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette