X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=balloon.c;h=e321f2c6886dae5c96bc7a38c4ffa0f45590d45e;hb=327e75b537c3b7bc25ac83bedeb4a40c782796c3;hp=0166744aa89ae67827e2ccf9579e3fb7ae8cf269;hpb=cde7fc31dee7a7bac96779f77a21825b187871d3;p=qemu.git diff --git a/balloon.c b/balloon.c index 0166744aa..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; @@ -108,7 +122,7 @@ void qmp_balloon(int64_t value, Error **errp) } if (value <= 0) { - qerror_report(QERR_INVALID_PARAMETER_VALUE, "target", "a size"); + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); return; }