X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/0d81cdddaa40a1988b24657aeac19959cfad0fde..1787efc3d217ae513b45f7f965cdf3f751bc8c3c:/balloon.c diff --git a/balloon.c b/balloon.c index c7033e3dc3..1d720fff81 100644 --- a/balloon.c +++ b/balloon.c @@ -24,17 +24,30 @@ * THE SOFTWARE. */ -#include "monitor/monitor.h" +#include "qemu/osdep.h" +#include "qemu-common.h" #include "exec/cpu-common.h" #include "sysemu/kvm.h" #include "sysemu/balloon.h" -#include "trace.h" +#include "trace-root.h" #include "qmp-commands.h" +#include "qapi/qmp/qerror.h" #include "qapi/qmp/qjson.h" static QEMUBalloonEvent *balloon_event_fn; static QEMUBalloonStatus *balloon_stat_fn; static void *balloon_opaque; +static bool balloon_inhibited; + +bool qemu_balloon_is_inhibited(void) +{ + return balloon_inhibited; +} + +void qemu_balloon_inhibit(bool state) +{ + balloon_inhibited = state; +} static bool have_balloon(Error **errp) { @@ -96,7 +109,7 @@ void qmp_balloon(int64_t target, Error **errp) } if (target <= 0) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); return; }