VirtualBox

Changeset 18113 in vbox for trunk/src


Ignore:
Timestamp:
Mar 20, 2009 12:54:04 PM (16 years ago)
Author:
vboxsync
Message:

don't spam the release log if Guest::GetStatistic() fails

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r18072 r18113  
    16521652
    16531653            rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &statVal);
    1654             if (details == VMINFO_MACHINEREADABLE)
    1655                 RTPrintf("StatGuestSample=%d\n", statVal);
    1656             else
    1657                 RTPrintf("Guest statistics for sample %d:\n\n", statVal);
     1654            if (SUCCEEDED(rc))
     1655            {
     1656                if (details == VMINFO_MACHINEREADABLE)
     1657                    RTPrintf("StatGuestSample=%d\n", statVal);
     1658                else
     1659                    RTPrintf("Guest statistics for sample %d:\n\n", statVal);
     1660            }
    16581661
    16591662            rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
  • trunk/src/VBox/Main/GuestImpl.cpp

    r16125 r18113  
    292292    CheckComArgOutPointerValid(aStatVal);
    293293
    294     /* not available or not yet reported? */
    295     CheckComArgExpr(aStatistic, mCurrentGuestStat[aStatistic] != GUEST_STAT_INVALID);
     294    /* Not available or not yet reported? In that case, just return with a proper error
     295     * but don't use setError(). */
     296    if (mCurrentGuestStat[aStatistic] == GUEST_STAT_INVALID)
     297        return E_INVALIDARG;
    296298
    297299    *aStatVal = mCurrentGuestStat[aStatistic];
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