Commit 664535c3 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  build: install qmp-commands.txt
  Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
  Add event notification for guest balloon changes
  Fix some more license versions (GPL2+ instead of GPL2)
  monitor: Fix memory leak with readline completion
  qmp: do not include monitor.h from qapi-types-core.h
  qmp: include monitor.h when needed
  kvm: add missing include files
parents 0b0cb9d3 0cd23fcc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -272,6 +272,7 @@ endif
install-doc: $(DOCS)
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
ifdef CONFIG_POSIX
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
+18 −0
Original line number Diff line number Diff line
@@ -335,3 +335,21 @@ Example:
               "len": 10737418240, "offset": 134217728,
               "speed": 0 },
     "timestamp": { "seconds": 1267061043, "microseconds": 959568 } }


BALLOON_CHANGE
----------

Emitted when the guest changes the actual BALLOON level. This
value is equivalent to the 'actual' field return by the
'query-balloon' command

Data:

- "actual": actual level of the guest memory balloon in bytes (json-number)

Example:

{ "event": "BALLOON_CHANGE",
    "data": { "actual": 944766976 },
    "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
+14 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include "balloon.h"
#include "trace.h"
#include "qmp-commands.h"
#include "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;
+2 −0
Original line number Diff line number Diff line
@@ -24,4 +24,6 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
			     QEMUBalloonStatus *stat_func, void *opaque);
void qemu_remove_balloon_handler(void *opaque);

void qemu_balloon_changed(int64_t actual);

#endif
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "qemu-option.h"
#include "qemu-timer.h"
#include "qmp-commands.h"
#include "monitor.h"

static void hmp_handle_error(Monitor *mon, Error **errp)
{
Loading