VirtualBox

Changeset 4528 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2007 9:19:39 AM (17 years ago)
Author:
vboxsync
Message:

Guest statistics interval updates (xml, imachine, iguest)

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

Legend:

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

    r4513 r4528  
    177177    CheckComRCReturnRC (autoCaller.rc());
    178178
    179     AutoReaderLock alock (this);
     179    AutoLock alock (this);
    180180
    181181    HRESULT ret = mParent->machine()->COMSETTER(MemoryBalloonSize)(aMemoryBalloonSize);
     
    212212    CheckComRCReturnRC (autoCaller.rc());
    213213
    214     AutoReaderLock alock (this);
    215 
    216     mStatUpdateInterval = aUpdateInterval;
    217 
    218     return S_OK;
     214    AutoLock alock (this);
     215
     216    HRESULT ret = mParent->machine()->COMSETTER(StatisticsUpdateInterval)(aUpdateInterval);
     217    if (ret == S_OK)
     218    {
     219        mStatUpdateInterval = aUpdateInterval;
     220        /* forward the information to the VMM device */
     221        VMMDev *vmmDev = mParent->getVMMDev();
     222        if (vmmDev)
     223            vmmDev->getVMMDevPort()->pfnSetStatisticsInterval(vmmDev->getVMMDevPort(), aUpdateInterval);
     224    }
     225
     226    return ret;
    219227}
    220228
  • trunk/src/VBox/Main/MachineImpl.cpp

    r4513 r4528  
    166166    mMemorySize = 128;
    167167    mMemoryBalloonSize = 0;
     168    mStatisticsUpdateInterval = 0;
    168169    mVRAMSize = 8;
    169170    mMonitorCount = 1;
     
    191192    if (mMemorySize != that.mMemorySize ||
    192193        mMemoryBalloonSize != that.mMemoryBalloonSize ||
     194        mStatisticsUpdateInterval != that.mStatisticsUpdateInterval ||
    193195        mVRAMSize != that.mVRAMSize ||
    194196        mMonitorCount != that.mMonitorCount ||
     
    981983}
    982984
    983 
     985/** @todo this method should not be public */
    984986STDMETHODIMP Machine::COMGETTER(MemoryBalloonSize) (ULONG *memoryBalloonSize)
    985987{
     
    997999}
    9981000
     1001/** @todo this method should not be public */
    9991002STDMETHODIMP Machine::COMSETTER(MemoryBalloonSize) (ULONG memoryBalloonSize)
    10001003{
     
    10151018    mHWData.backup();
    10161019    mHWData->mMemoryBalloonSize = memoryBalloonSize;
     1020
     1021    return S_OK;
     1022}
     1023
     1024/** @todo this method should not be public */
     1025STDMETHODIMP Machine::COMGETTER(StatisticsUpdateInterval) (ULONG *statisticsUpdateInterval)
     1026{
     1027    if (!statisticsUpdateInterval)
     1028        return E_POINTER;
     1029
     1030    AutoCaller autoCaller (this);
     1031    CheckComRCReturnRC (autoCaller.rc());
     1032
     1033    AutoReaderLock alock (this);
     1034
     1035    *statisticsUpdateInterval = mHWData->mStatisticsUpdateInterval;
     1036
     1037    return S_OK;
     1038}
     1039
     1040/** @todo this method should not be public */
     1041STDMETHODIMP Machine::COMSETTER(StatisticsUpdateInterval) (ULONG statisticsUpdateInterval)
     1042{
     1043    AutoCaller autoCaller (this);
     1044    CheckComRCReturnRC (autoCaller.rc());
     1045
     1046    AutoLock alock (this);
     1047
     1048    HRESULT rc = checkStateDependency (MutableStateDep);
     1049    CheckComRCReturnRC (rc);
     1050
     1051    mHWData.backup();
     1052    mHWData->mStatisticsUpdateInterval = statisticsUpdateInterval;
    10171053
    10181054    return S_OK;
     
    37733809                mHWData->mMemoryBalloonSize = memoryBalloonSize;
    37743810
     3811                uint32_t statisticsUpdateInterval = 0;
     3812                CFGLDRQueryUInt32 (GuestNode, "StatisticsUpdateInterval", &statisticsUpdateInterval);
     3813                mHWData->mStatisticsUpdateInterval = statisticsUpdateInterval;
     3814
    37753815                CFGLDRReleaseNode (GuestNode);
    37763816            }
     
    54565496            if (GuestNode)
    54575497            {
    5458                 CFGLDRSetUInt32 (GuestNode, "MemoryBalloonSize", mHWData->mMemoryBalloonSize);
     5498                CFGLDRSetUInt32 (GuestNode, "MemoryBalloonSize",  mHWData->mMemoryBalloonSize);
     5499                CFGLDRSetUInt32 (GuestNode, "StatisticsUpdateInterval", mHWData->mStatisticsUpdateInterval);               
    54595500                CFGLDRReleaseNode (GuestNode);
    54605501            }
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r4513 r4528  
    20212021  <interface
    20222022     name="IMachine" extends="$unknown"
    2023      uuid="dcfb87c4-18a9-4a1e-9b1f-6f68f920535b"
     2023     uuid="2830ce8c-be5b-4660-b8d5-65d913005b4f"
    20242024     wsmap="managed"
    20252025     >
     
    21752175    </attribute>
    21762176
     2177    <attribute name="statisticsUpdateInterval" type="unsigned long">
     2178      <desc>Initial interval to update guest statistics in seconds.</desc>
     2179    </attribute>
     2180
    21772181    <attribute name="VRAMSize" type="unsigned long">
    21782182      <desc>Video memory size in megabytes.</desc>
  • trunk/src/VBox/Main/include/MachineImpl.h

    r4513 r4528  
    222222        ULONG          mMemorySize;
    223223        ULONG          mMemoryBalloonSize;
     224        ULONG          mStatisticsUpdateInterval;
    224225        ULONG          mVRAMSize;
    225226        ULONG          mMonitorCount;
     
    444445    STDMETHOD(COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize);
    445446    STDMETHOD(COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize);
     447    STDMETHOD(COMGETTER(StatisticsUpdateInterval))(ULONG *statisticsUpdateInterval);
     448    STDMETHOD(COMSETTER(StatisticsUpdateInterval))(ULONG statisticsUpdateInterval);
    446449    STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize);
    447450    STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r4513 r4528  
    384384
    385385<xsd:complexType name="TGuest">
    386   <xsd:attribute name="MemoryBalloonSize" type="xsd:unsignedInt" default="0"/>
     386  <xsd:attribute name="MemoryBalloonSize"  type="xsd:unsignedInt" default="0"/>
     387  <xsd:attribute name="StatisticsInterval" type="xsd:unsignedInt" default="0"/>
    387388</xsd:complexType>
    388389
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