diff mbox

[15/21] qga: register event emit function

Message ID 20170311132256.22951-16-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau March 11, 2017, 1:22 p.m. UTC
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qga/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/qga/main.c b/qga/main.c
index 1c39895baa..8e852bd556 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -39,6 +39,7 @@ 
 #define CONFIG_FSFREEZE
 #endif
 #endif
+#include "qapi/qmp-event.h"
 
 #ifndef _WIN32
 #define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0"
@@ -1488,6 +1489,12 @@  end:
 #endif
 }
 
+static void
+monitor_qapi_event_queue(qga_QAPIEvent event, QDict *qdict, Error **errp)
+{
+    send_response(ga_state, QOBJECT(qdict));
+}
+
 int main(int argc, char **argv)
 {
     int ret = EXIT_SUCCESS;
@@ -1496,6 +1503,7 @@  int main(int argc, char **argv)
     int listen_fd;
 
     update_vmdump_info(s);
+    qmp_event_set_func_emit(monitor_qapi_event_queue);
 
     config->log_level = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL;