Changeset 4647 in vbox for trunk/src/VBox/Main
- Timestamp:
- Sep 10, 2007 8:26:51 AM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r4608 r4647 80 80 mStatUpdateInterval = 0; /* Default is not to report guest statistics at all */ 81 81 82 for (int i=0;i<GuestStatisticType_MaxVal;i++) 83 mCurrentGuestStat[i] = GUEST_STAT_INVALID; 84 82 85 return S_OK; 83 86 } … … 271 274 return E_INVALIDARG; 272 275 273 switch(aStatistic) 274 { 275 case GuestStatisticType_CPULoad_Idle: 276 case GuestStatisticType_CPULoad_Kernel: 277 case GuestStatisticType_CPULoad_User: 278 case GuestStatisticType_Threads: 279 case GuestStatisticType_Processes: 280 case GuestStatisticType_Handles: 281 case GuestStatisticType_MemoryLoad: 282 case GuestStatisticType_PhysMemTotal: 283 case GuestStatisticType_PhysMemAvailable: 284 case GuestStatisticType_PhysMemBalloon: 285 case GuestStatisticType_MemCommitTotal: 286 case GuestStatisticType_MemKernelTotal: 287 case GuestStatisticType_MemKernelPaged: 288 case GuestStatisticType_MemKernelNonpaged: 289 case GuestStatisticType_MemSystemCache: 290 case GuestStatisticType_PageFileSize: 291 *aStatVal = 0; 292 break; 293 294 default: 295 AssertFailed(); 296 return E_INVALIDARG; 297 } 276 if (aStatistic >= GuestStatisticType_MaxVal) 277 return E_INVALIDARG; 278 279 /* not available or not yet reported? */ 280 if (mCurrentGuestStat[aStatistic] == GUEST_STAT_INVALID) 281 return E_INVALIDARG; 282 283 *aStatVal = mCurrentGuestStat[aStatistic]; 298 284 return S_OK; 299 285 } … … 304 290 return E_INVALIDARG; 305 291 306 switch(aStatistic) 307 { 308 case GuestStatisticType_CPULoad_Idle: 309 case GuestStatisticType_CPULoad_Kernel: 310 case GuestStatisticType_CPULoad_User: 311 case GuestStatisticType_Threads: 312 case GuestStatisticType_Processes: 313 case GuestStatisticType_Handles: 314 case GuestStatisticType_MemoryLoad: 315 case GuestStatisticType_PhysMemTotal: 316 case GuestStatisticType_PhysMemAvailable: 317 case GuestStatisticType_PhysMemBalloon: 318 case GuestStatisticType_MemCommitTotal: 319 case GuestStatisticType_MemKernelTotal: 320 case GuestStatisticType_MemKernelPaged: 321 case GuestStatisticType_MemKernelNonpaged: 322 case GuestStatisticType_MemSystemCache: 323 case GuestStatisticType_PageFileSize: 324 break; 325 326 default: 327 AssertFailed(); 328 return E_INVALIDARG; 329 } 292 if (aStatistic >= GuestStatisticType_MaxVal) 293 return E_INVALIDARG; 294 295 /* internal method assumes that the caller known what he's doing (no boundary checks) */ 296 mCurrentGuestStat[aStatistic] = aStatVal; 330 297 return S_OK; 331 298 } -
trunk/src/VBox/Main/include/GuestImpl.h
r4571 r4647 22 22 23 23 class Console; 24 25 #define GUEST_STAT_INVALID (ULONG)-1 24 26 25 27 class ATL_NO_VTABLE Guest : … … 91 93 ULONG mStatUpdateInterval; 92 94 95 ULONG mCurrentGuestStat[GuestStatisticType_MaxVal]; 96 93 97 ComObjPtr <Console, ComWeakRef> mParent; 94 98 Data mData;
Note:
See TracChangeset
for help on using the changeset viewer.