summaryrefslogtreecommitdiffstats
path: root/balloon.h
authorAdam Litke <[email protected]>2010-01-26 20:17:35 (GMT)
committer Anthony Liguori <[email protected]>2010-01-26 23:08:03 (GMT)
commit625a5befc2e3200b396594f002218d235e375da5 (patch) (side-by-side diff)
tree89b9362c879d319b5061424035e3dbead9555e70 /balloon.h
parent940cc30d0d456781adcc48bf9f8c5582026d7983 (diff)
downloadqemu-kvm-625a5befc2e3200b396594f002218d235e375da5.zip
qemu-kvm-625a5befc2e3200b396594f002218d235e375da5.tar.gz
qemu-kvm-625a5befc2e3200b396594f002218d235e375da5.tar.bz2
virtio: Add memory statistics reporting to the balloon driver
When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information that will minimize the impact of ballooning on the guests. The current method employs a daemon running in each guest that communicates memory statistics to a host daemon at a specified time interval. The host daemon aggregates this information and inflates and/or deflates balloons according to the level of host memory pressure. This approach is effective but overly complex since a daemon must be installed inside each guest and coordinated to communicate with the host. A simpler approach is to collect memory statistics in the virtio balloon driver and communicate them directly to the hypervisor. Signed-off-by: Adam Litke <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
Diffstat (limited to 'balloon.h') (more/less context) (ignore whitespace changes)
-rw-r--r--balloon.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/balloon.h b/balloon.h
index 60b4a5d..c3a1ad3 100644
--- a/balloon.h
+++ b/balloon.h
@@ -16,12 +16,13 @@
#include "cpu-defs.h"
-typedef ram_addr_t (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
+typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target,
+ MonitorCompletion cb, void *cb_data);
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque);
-void qemu_balloon(ram_addr_t target);
+int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque);
-ram_addr_t qemu_balloon_status(void);
+int qemu_balloon_status(MonitorCompletion cb, void *opaque);
#endif