VirtualBox

Changeset 4571 in vbox


Ignore:
Timestamp:
Sep 6, 2007 12:31:23 PM (17 years ago)
Author:
vboxsync
Message:

Future proof

Location:
trunk
Files:
5 edited

Legend:

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

    r4570 r4571  
    371371typedef struct VBoxGuestStatistics
    372372{
     373    /** Virtual CPU id */
     374    uint32_t        u32CpuId;
    373375    /** Reported statistics */
    374376    uint32_t        u32StatCaps;
  • trunk/src/VBox/Main/GuestImpl.cpp

    r4570 r4571  
    263263}
    264264
    265 STDMETHODIMP Guest::GetStatistic(GuestStatisticType_T statistic, ULONG *aStatVal)
     265STDMETHODIMP Guest::GetStatistic(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal)
    266266{
    267267    if (!aStatVal)
    268268        return E_INVALIDARG;
    269269
    270     switch(statistic)
     270    if (aCpuId != 0)
     271        return E_INVALIDARG;
     272
     273    switch(aStatistic)
    271274    {
    272275    case GuestStatisticType_CPULoad_Idle:
     
    288291}
    289292
    290 STDMETHODIMP Guest::SetStatistic(GuestStatisticType_T statistic, ULONG aStatVal)
    291 {
    292     switch(statistic)
     293STDMETHODIMP Guest::SetStatistic(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal)
     294{
     295    if (aCpuId != 0)
     296        return E_INVALIDARG;
     297
     298    switch(aStatistic)
    293299    {
    294300    case GuestStatisticType_CPULoad_Idle:
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r4570 r4571  
    405405
    406406    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_IDLE)
    407         guest->SetStatistic(GuestStatisticType_CPULoad_Idle, pGuestStats->u32CpuLoad_Idle);
     407        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_CPULoad_Idle, pGuestStats->u32CpuLoad_Idle);
    408408
    409409    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_KERNEL)
    410         guest->SetStatistic(GuestStatisticType_CPULoad_Kernel, pGuestStats->u32CpuLoad_Kernel);
     410        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_CPULoad_Kernel, pGuestStats->u32CpuLoad_Kernel);
    411411
    412412    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_USER)
    413         guest->SetStatistic(GuestStatisticType_CPULoad_User, pGuestStats->u32CpuLoad_User);
     413        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_CPULoad_User, pGuestStats->u32CpuLoad_User);
    414414
    415415    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_THREADS)
    416         guest->SetStatistic(GuestStatisticType_Threads, pGuestStats->u32Threads);
     416        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Threads, pGuestStats->u32Threads);
    417417
    418418    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PROCESSES)
    419         guest->SetStatistic(GuestStatisticType_Processes, pGuestStats->u32Processes);
     419        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Processes, pGuestStats->u32Processes);
    420420
    421421    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_TOTAL)
    422         guest->SetStatistic(GuestStatisticType_PhysMemTotal, pGuestStats->u32PhysMemTotal);
     422        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemTotal, pGuestStats->u32PhysMemTotal);
    423423
    424424    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_AVAIL)
    425         guest->SetStatistic(GuestStatisticType_PhysMemAvailable, pGuestStats->u32PhysMemAvail);
     425        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemAvailable, pGuestStats->u32PhysMemAvail);
    426426
    427427    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON)
    428         guest->SetStatistic(GuestStatisticType_PhysMemBalloon, pGuestStats->u32PhysMemBalloon);
     428        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemBalloon, pGuestStats->u32PhysMemBalloon);
    429429
    430430    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE)
    431         guest->SetStatistic(GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize);
     431        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize);
    432432
    433433    return VINF_SUCCESS;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r4570 r4571  
    43804380  <interface
    43814381     name="IGuest" extends="$unknown"
    4382      uuid="5d54a565-813c-42a0-a81a-e31779e03186"
     4382     uuid="c101f037-b03d-4bd4-bd25-381123980be2"
    43834383     wsmap="suppress"
    43844384     >
     
    44684468        Query specified guest statistics as reported by the VirtualBox Additions.
    44694469      </desc>
     4470      <param name="cpuId" type="unsigned long" dir="in">
     4471        <desc>Virtual CPU id; not relevant for all statistic types</desc>
     4472      </param>
    44704473      <param name="statistic" type="GuestStatisticType" dir="in">
    44714474        <desc>Statistic type.</desc>
  • trunk/src/VBox/Main/include/GuestImpl.h

    r4318 r4571  
    6464    STDMETHOD(SetCredentials)(INPTR BSTR aUserName, INPTR BSTR aPassword,
    6565                              INPTR BSTR aDomain, BOOL aAllowInteractiveLogon);
    66     STDMETHOD(GetStatistic)(GuestStatisticType_T statistic, ULONG *aStatVal);
     66    STDMETHOD(GetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal);
    6767
    6868    // public methods that are not in IDL
     
    7171    void setSupportsSeamless (BOOL aSupportsSeamless);
    7272
    73     STDMETHOD(SetStatistic)(GuestStatisticType_T statistic, ULONG aStatVal);
     73    STDMETHOD(SetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal);
    7474
    7575    // for VirtualBoxSupportErrorInfoImpl
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