VirtualBox

Ignore:
Timestamp:
Apr 26, 2010 9:24:35 AM (15 years ago)
Author:
vboxsync
Message:

VBoxService: Compilable/runnable without memory ballooning.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk

    r28254 r28736  
    2929PROGRAMS.win.x86 += VBoxServiceNT
    3030
     31# Hack. Should be in Config.kmk later!
     32VBOX_WITH_MEMBALLOON     := 1
     33
    3134#
    3235# VBoxService
     
    4144  VBoxService_DEFS       += VBOXSERVICE_EXEC
    4245 endif
    43 ifdef VBOX_WITH_GUEST_CONTROL
     46 ifdef VBOX_WITH_GUEST_CONTROL
    4447  VBoxService_DEFS       += VBOX_WITH_GUEST_CONTROL VBOXSERVICE_CONTROL
     48 endif
    4549endif
     50ifdef VBOX_WITH_MEMBALLOON
     51 VBoxService_DEFS        += VBOX_WITH_MEMBALLOON
    4652endif
    4753ifdef VBOX_WITH_PAGE_SHARING
    48   VBoxService_DEFS       += VBOX_WITH_PAGE_SHARING
     54 VBoxService_DEFS        += VBOX_WITH_PAGE_SHARING
    4955endif
    5056if1of ($(KBUILD_TARGET), linux)
     
    5662        VBoxServiceTimeSync.cpp \
    5763        VBoxServiceUtils.cpp \
    58         VBoxServiceBalloon.cpp \
    5964        VBoxServiceStats.cpp
    6065ifdef VBOX_WITH_GUEST_CONTROL
     
    6267        VBoxServiceControl.cpp \
    6368        VBoxServiceControlExec.cpp
     69endif
     70ifdef VBOX_WITH_MEMBALLOON
     71 VBoxService_SOURCES    += \
     72        VBoxServiceBalloon.cpp
    6473endif
    6574ifdef VBOX_WITH_PAGE_SHARING
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r28604 r28736  
    9999#endif
    100100#ifdef VBOXSERVICE_MANAGEMENT
     101 #ifdef VBOX_WITH_MEMBALLOON
    101102    { &g_MemBalloon, NIL_RTTHREAD, false, false, false, true },
     103 #endif   
    102104    { &g_VMStatistics, NIL_RTTHREAD, false, false, false, true },
    103105#endif
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp

    r28508 r28736  
    208208    req.guestStats.u32PageFileSize      = (uint32_t)(memStatus.ullTotalPageFile / _4K) - req.guestStats.u32PhysMemTotal;
    209209    req.guestStats.u32MemoryLoad        = memStatus.dwMemoryLoad;
     210        req.guestStats.u32StatCaps          = VBOX_GUEST_STAT_PHYS_MEM_TOTAL | VBOX_GUEST_STAT_PHYS_MEM_AVAIL | VBOX_GUEST_STAT_PAGE_FILE_SIZE
     211                                                                                | VBOX_GUEST_STAT_MEMORY_LOAD;
     212#ifdef VBOX_WITH_MEMBALLOON
    210213    req.guestStats.u32PhysMemBalloon    = VBoxServiceBalloonQueryPages(_4K);
    211     req.guestStats.u32StatCaps          = VBOX_GUEST_STAT_PHYS_MEM_TOTAL | VBOX_GUEST_STAT_PHYS_MEM_AVAIL | VBOX_GUEST_STAT_PAGE_FILE_SIZE
    212                                         | VBOX_GUEST_STAT_MEMORY_LOAD | VBOX_GUEST_STAT_PHYS_MEM_BALLOON;
     214    req.guestStats.u32StatCaps         |= VBOX_GUEST_STAT_PHYS_MEM_BALLOON;
     215#else
     216        req.guestStats.u32PhysMemBalloon    = 0;
     217#endif
    213218
    214219    if (gCtx.pfnGetPerformanceInfo)
     
    348353
    349354    req.guestStats.u32PageSize = getpagesize();
    350     req.guestStats.u32PhysMemBalloon = VBoxServiceBalloonQueryPages(_4K);
    351     req.guestStats.u32StatCaps = VBOX_GUEST_STAT_PHYS_MEM_TOTAL \
    352                                | VBOX_GUEST_STAT_PHYS_MEM_AVAIL \
    353                                | VBOX_GUEST_STAT_PHYS_MEM_BALLOON \
    354                                | VBOX_GUEST_STAT_PAGE_FILE_SIZE;
     355        req.guestStats.u32StatCaps  = VBOX_GUEST_STAT_PHYS_MEM_TOTAL \
     356                                                            | VBOX_GUEST_STAT_PHYS_MEM_AVAIL \
     357                                                            | VBOX_GUEST_STAT_PAGE_FILE_SIZE;
     358#ifdef VBOX_WITH_MEMBALLOON
     359    req.guestStats.u32PhysMemBalloon  = VBoxServiceBalloonQueryPages(_4K);
     360    req.guestStats.u32StatCaps       |= VBOX_GUEST_STAT_PHYS_MEM_BALLOON;
     361#else
     362    req.guestStats.u32PhysMemBalloon  = 0;
     363#endif
     364
    355365
    356366    /** @todo req.guestStats.u32Threads */
     
    519529        /** @todo req.guestStats.u32MemKernelNonPaged */
    520530        req.guestStats.u32PageSize = getpagesize();
    521         req.guestStats.u32PhysMemBalloon = VBoxServiceBalloonQueryPages(_4K);
     531
    522532        req.guestStats.u32StatCaps = VBOX_GUEST_STAT_PHYS_MEM_TOTAL \
    523533                                   | VBOX_GUEST_STAT_PHYS_MEM_AVAIL \
    524                                    | VBOX_GUEST_STAT_PHYS_MEM_BALLOON \
    525534                                   | VBOX_GUEST_STAT_PAGE_FILE_SIZE;
     535#ifdef VBOX_WITH_MEMBALLOON
     536                req.guestStats.u32PhysMemBalloon  = VBoxServiceBalloonQueryPages(_4K);
     537                req.guestStats.u32StatCaps       |= VBOX_GUEST_STAT_PHYS_MEM_BALLOON;
     538#else
     539                req.guestStats.u32PhysMemBalloon  = 0;
     540#endif
    526541
    527542        /*
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