VirtualBox

Changeset 4575 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 6, 2007 2:41:38 PM (17 years ago)
Author:
vboxsync
Message:

Updates

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxGuest.cpp

    r4573 r4575  
    155155    gCtx.pfnGlobalMemoryStatusEx(&memStatus);
    156156
     157    req.guestStats.u32PageSize          = systemInfo.dwPageSize;
    157158    req.guestStats.u32PhysMemTotal      = (uint32_t)(memStatus.ullTotalPhys / systemInfo.dwPageSize);
    158159    req.guestStats.u32PhysMemAvail      = (uint32_t)(memStatus.ullAvailPhys / systemInfo.dwPageSize);
    159160    req.guestStats.u32PageFileSize      = (uint32_t)(memStatus.ullTotalPageFile / systemInfo.dwPageSize);
    160161    req.guestStats.u32MemoryLoad        = memStatus.dwMemoryLoad;
    161     req.guestStats.u32PhysMemBalloon    = pCtx->uMemBalloonSize;    /* in megabytes already */
     162    req.guestStats.u32PhysMemBalloon    = pCtx->uMemBalloonSize * (_1M/systemInfo.dwPageSize);    /* was in megabytes */
    162163    req.guestStats.u32StatCaps          = VBOX_GUEST_STAT_PHYS_MEM_TOTAL | VBOX_GUEST_STAT_PHYS_MEM_AVAIL | VBOX_GUEST_STAT_PAGE_FILE_SIZE | VBOX_GUEST_STAT_MEMORY_LOAD | VBOX_GUEST_STAT_PHYS_MEM_BALLOON;
    163164
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r4571 r4575  
    419419        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Processes, pGuestStats->u32Processes);
    420420
     421    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_HANDLES)
     422        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_Handles, pGuestStats->u32Handles);
     423
     424    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEMORY_LOAD)
     425        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemoryLoad, pGuestStats->u32MemoryLoad);
     426
     427    /* Note that reported values are in pages; upper layers expect them in megabytes */
     428    Assert(pGuestState->u32PageSize == 4096);
     429    if (!pGuestState->u32PageSize)
     430        pGuestState->u32PageSize = 4096;
     431
    421432    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_TOTAL)
    422         guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemTotal, pGuestStats->u32PhysMemTotal);
     433        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemTotal, pGuestStats->u32PhysMemTotal * (_1M/pGuestState->u32PageSize));
    423434
    424435    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_AVAIL)
    425         guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemAvailable, pGuestStats->u32PhysMemAvail);
     436        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemAvailable, pGuestStats->u32PhysMemAvail * (_1M/pGuestState->u32PageSize));
    426437
    427438    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON)
    428         guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemBalloon, pGuestStats->u32PhysMemBalloon);
    429 
     439        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PhysMemBalloon, pGuestStats->u32PhysMemBalloon * (_1M/pGuestState->u32PageSize));
     440
     441    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_COMMIT_TOTAL)
     442        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemCommitTotal, pGuestStats->u32MemCommitTotal * (_1M/pGuestState->u32PageSize));
     443
     444    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_TOTAL)
     445        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelTotal, pGuestStats->u32MemKernelTotal * (_1M/pGuestState->u32PageSize));
     446
     447    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_PAGED)
     448        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelPaged, pGuestStats->u32MemKernelPaged * (_1M/pGuestState->u32PageSize));
     449
     450    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_KERNEL_NONPAGED)
     451        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemKernelNonpaged, pGuestStats->u32MemKernelNonPaged * (_1M/pGuestState->u32PageSize));
     452
     453    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_SYSTEM_CACHE)
     454        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemSystemCache, pGuestStats->u32MemSystemCache * (_1M/pGuestState->u32PageSize));
     455   
    430456    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE)
    431         guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize);
     457        guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize * (_1M/pGuestState->u32PageSize));
    432458
    433459    return VINF_SUCCESS;
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