Commit Graph
15 Commits
Author SHA1 Message Date
Gal Hammer 270d0191b4 balloon: bz#1766844 add new memory statistics tags.
Signed-off-by: Gal Hammer <[email protected]>
2020-07-26 14:25:26 +03:00
Ladi Prosek 08c0ce54af balloon: Static analysis: blnsvr fixes
Static analysis was failing with:

app\device.cpp(190): warning C6258: Using TerminateThread does not allow proper thread clean up.
app\main.cpp(30): warning C28285: For function 'wmain' '_Param_(2)' syntax error in 'SAL_readableTo(elementCount(Argc))' near 'Argc))'.
app\main.cpp(51): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'.
app\memstat.cpp(28): warning C6214: Cast between semantically different integer types:  HRESULT to a Boolean type.
app\memstat.cpp(162): warning C6386: Buffer overrun while writing to 'this->m_Stats':  the writable size is '70' bytes, but '80' bytes might be written.
app\service.cpp(231): warning C6031: Return value ignored: 'QueryServiceStatus'.
app\service.cpp(257): warning C6001: Using uninitialized memory 'CurrentState'.
app\utils.cpp(28): warning C6387: 'pLog' could be '0':  this does not adhere to the specification for the function 'fprintf'.
app\utils.cpp(29): warning C6387: 'pLog' could be '0':  this does not adhere to the specification for the function 'fclose'. See line 28 for an earlier location where this can occur
app\utils.cpp(104): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 81 for an earlier location where this can occur
app\utils.cpp(80): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CreateServiceW'.
app\utils.cpp(140): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'DeleteService'. See line 126 for an earlier location where this can occur
app\utils.cpp(147): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 126 for an earlier location where this can occur
app\utils.cpp(148): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 121 for an earlier location where this can occur
app\utils.cpp(133): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'ControlService'. See line 126 for an earlier location where this can occur
app\utils.cpp(121): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'.
app\utils.cpp(126): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'QueryServiceStatus'.
app\utils.cpp(178): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem
app\utils.cpp(197): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem
app\utils.cpp(200): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem
app\utils.cpp(221): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 167 for an earlier location where this can occur
app\utils.cpp(167): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'.
app\utils.cpp(255): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 238 for an earlier location where this can occur
app\utils.cpp(254): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'.
app\utils.cpp(238): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'.
app\utils.cpp(245): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'ControlService'.
app\utils.cpp(248): warning C6001: Using uninitialized memory 'res'.
app\utils.cpp(279): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'QueryServiceConfigW'.
app\utils.cpp(273): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'.
app\utils.cpp(292): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 279 for an earlier location where this can occur
app\utils.cpp(293): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 273 for an earlier location where this can occur
app\utils.cpp(284): warning C28182: Dereferencing NULL pointer. 'buffer' contains the same NULL value as 'LocalAlloc()`278' did.
app\utils.cpp(317): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'ChangeServiceConfigW'.
app\utils.cpp(339): warning C6387: 'service' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 318 for an earlier location where this can occur
app\utils.cpp(335): warning C6387: 'lock' could be '0':  this does not adhere to the specification for the function 'UnlockServiceDatabase'.
app\utils.cpp(340): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'CloseServiceHandle'. See line 309 for an earlier location where this can occur
app\utils.cpp(309): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'LockServiceDatabase'.
app\utils.cpp(313): warning C6387: 'scm' could be '0':  this does not adhere to the specification for the function 'OpenServiceW'. See line 309 for an earlier location where this can occur

This commit fixes everything except for:

app\device.cpp(190): warning C6258: Using TerminateThread does not allow proper thread clean up.
app\utils.cpp(178): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem
app\utils.cpp(197): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem
app\utils.cpp(200): warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days.  Code that does not take that into account can loop indefinitely.  GetTickCount64 operates on 64 bit values and does not have that problem

Signed-off-by: Ladi Prosek <[email protected]>
2017-12-16 21:35:58 +02:00
Ladi Prosek 5d6c7f8626 balloon: Don't create invalid VARIANTs
Setting vt to -1 does not produce a valid VARIANT. An exception is thrown
when one tries to extract data from such a variable.

The code was very likely intended to set the value to -1, which is the
unofficial "missing" marker used by QEMU.

Signed-off-by: Ladi Prosek <[email protected]>
2017-09-18 14:14:49 +02:00
Vadim Rozenfeld 0018caa266 Bug 1369353 - virtio_balloon: backport available memory stat support.
Trying to mimic what si_mem_available does in Linux. AvailPhys is the
sum of memory in free, zero and standby list. CacheBytes is the current
size of the system file cache.

Signed-off-by: Vadim Rozenfeld <[email protected]>
2017-09-17 11:23:53 +10:00
Ladi Prosek 64623e109a balloon: Re-add user-mode balloon service (Balloon/app)
This reverts commit 08e65ea and synces Balloon/app in the
master branch with stable. The goal is to have one unified
branch which can build both flavors of the balloon driver:
with and without the user-mode helper service.

Signed-off-by: Ladi Prosek <[email protected]>
2017-03-23 09:43:23 +01:00
Alexey V. Kostyushko 08e65ea3b3 Balloon: user-mode service app removed
There is no need of user-mode service anymore.
Building scripts were fixed.

Signed-off-by: Alexey V. Kostyushko <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
2016-02-07 23:10:46 +11:00
Vladimir Davydov 2a658e6e46 balloon: fix memory statistics reporting
According to libvirt API reference, SWAP_IN, SWAP_OUT, MAJOR_FAULT, and
MINOR_FAULT must be reported as total numbers, not per second, as they
are now. Besides, SWAP_IN and SWAP_OUT are supposed to be in bytes, not
in pages. Virtio balloon driver for Linux follows these conventions,
while balloon service for Windows does not, which makes it inconvenient
to use these statistics when Windows and Linux VMs are running on the
same host.

This patch fixes this issue.

Signed-off-by: Vladimir Davydov <[email protected]>
2016-01-02 22:22:54 +02:00
Gal Hammer f542c3f14d balloon: (related to bz#1082999) add device events handling.
A new implementation of the balloon's service which add handling of
device insertion and removal. It also prepare the service to work with
a new method of write request in the driver.
2014-06-14 23:42:41 +10:00
Vadim Rozenfeld c931908f00 [balloon] Bug 1080319 - win8.1-32 could use 3G memory in one guest but
stat-total-memory only shows 2G
2014-04-21 17:54:59 +10:00
Yan Vugenfirer e2dd053965 [balloon] Sync with Vadim's repository 2012-08-14 16:20:14 +02:00
Yan Vugenfirer 4992f5536e [Balloon] White spaces clean up 2011-12-06 17:32:42 +02:00
Yan Vugenfirer bd10c3ec3c Sync with Vadim's repository 2011-11-10 14:28:24 +02:00
Yan Vugenfirer 9f49609691 This repository only for the virtio library and NetKVM driver 2011-10-25 15:53:09 +02:00
Yan Vugenfirer 4f8c18671d [WIN-GUEST_DRIVERS] balloon: fix memory statistics report and fix service pause and uninstall logic.
Signed-off-by: Vadim Rozenfeld <[email protected]>
2010-05-25 11:55:35 +03:00
Yan Vugenfirer f6f446504d [WIN-GUEST_DRIVERS] Balloon: updated drivers and build scripts for balloon.
Signed-off-by: Vadim Rozenfeld <[email protected]>
2010-03-23 12:09:04 +02:00