X-Git-Url: https://git.proxmox.com/?p=qemu.git;a=blobdiff_plain;f=balloon.c;h=e321f2c6886dae5c96bc7a38c4ffa0f45590d45e;hp=aa354f75546122df10b4a9cba27e5725d8099c35;hb=8b7acc79b9adb4dda6cc867b90e3a1e873f4f7e8;hpb=a8b69b8e2431edfcb6c4cfb069787e9071d6235b diff --git a/balloon.c b/balloon.c index aa354f755..e321f2c68 100644 --- a/balloon.c +++ b/balloon.c @@ -24,12 +24,13 @@ * THE SOFTWARE. */ -#include "monitor.h" -#include "cpu-common.h" -#include "kvm.h" -#include "balloon.h" +#include "monitor/monitor.h" +#include "exec/cpu-common.h" +#include "sysemu/kvm.h" +#include "sysemu/balloon.h" #include "trace.h" #include "qmp-commands.h" +#include "qapi/qmp/qjson.h" static QEMUBalloonEvent *balloon_event_fn; static QEMUBalloonStatus *balloon_stat_fn; @@ -80,6 +81,19 @@ static int qemu_balloon_status(BalloonInfo *info) return 1; } +void qemu_balloon_changed(int64_t actual) +{ + QObject *data; + + data = qobject_from_jsonf("{ 'actual': %" PRId64 " }", + actual); + + monitor_protocol_event(QEVENT_BALLOON_CHANGE, data); + + qobject_decref(data); +} + + BalloonInfo *qmp_query_balloon(Error **errp) { BalloonInfo *info;