From 0d1ea871b09fc74b4a2085150980b43bd1973744 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Thu, 26 Nov 2009 22:59:03 -0200 Subject: QMP: Asynchronous events infrastructure Asynchronous events are generated with a call to monitor_protocol_event(). This function builds the right data-type and emit the event right away. The emitted data is always a JSON object and its format is as follows: { "event": json-string, "timestamp": { "seconds": json-number, "microseconds": json-number }, "data": json-value } This design is based on ideas by Amit Shah . Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori --- monitor.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'monitor.h') diff --git a/monitor.h b/monitor.h index 556507c..a1d8b7a 100644 --- a/monitor.h +++ b/monitor.h @@ -13,6 +13,12 @@ extern Monitor *cur_mon; #define MONITOR_USE_READLINE 0x02 #define MONITOR_USE_CONTROL 0x04 +/* QMP events */ +typedef enum MonitorEvent { + EVENT_MAX, +} MonitorEvent; + +void monitor_protocol_event(MonitorEvent event, QObject *data); const char *monitor_cmdline_parse(const char *cmdline, int *flags); void monitor_init(CharDriverState *chr, int flags); -- cgit v1.1