]> git.proxmox.com Git - qemu.git/commitdiff
monitor: Establish cmd flags and convert the async tag
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 15 Jun 2010 22:38:39 +0000 (00:38 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 1 Jul 2010 16:58:38 +0000 (13:58 -0300)
As we want to add more flags to monitor commands, convert the only so
far existing one accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c
monitor.h
qemu-monitor.hx

index b375f102b7589c051d76c1b33542ed7b36fc7407..980e98de0645b40c1b1d7f5de6459b2b48f99b0a 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -112,7 +112,7 @@ typedef struct mon_cmd_t {
         int  (*cmd_async)(Monitor *mon, const QDict *params,
                           MonitorCompletion *cb, void *opaque);
     } mhandler;
-    int async;
+    int flags;
 } mon_cmd_t;
 
 /* file descriptors passed via SCM_RIGHTS */
@@ -327,7 +327,7 @@ static inline int monitor_handler_ported(const mon_cmd_t *cmd)
 
 static inline bool monitor_handler_is_async(const mon_cmd_t *cmd)
 {
-    return cmd->async != 0;
+    return cmd->flags & MONITOR_CMD_ASYNC;
 }
 
 static inline int monitor_has_error(const Monitor *mon)
@@ -2536,7 +2536,7 @@ static const mon_cmd_t info_cmds[] = {
         .help       = "show balloon information",
         .user_print = monitor_print_balloon,
         .mhandler.info_async = do_info_balloon,
-        .async      = 1,
+        .flags      = MONITOR_CMD_ASYNC,
     },
     {
         .name       = "qtree",
index ea15469f25c30c253d44a46d982d0d5b2272ab54..9582b9cf1f34bf3f52836332e9deddebefdd6cf8 100644 (file)
--- a/monitor.h
+++ b/monitor.h
@@ -15,6 +15,9 @@ extern Monitor *default_mon;
 #define MONITOR_USE_READLINE  0x02
 #define MONITOR_USE_CONTROL   0x04
 
+/* flags for monitor commands */
+#define MONITOR_CMD_ASYNC       0x0001
+
 /* QMP events */
 typedef enum MonitorEvent {
     QEVENT_SHUTDOWN,
index 9f62b94862fa0b74ddacb4ea127715bd7fb42922..2af3de6c22952616b46671723ea3cee82bf1b14d 100644 (file)
@@ -1287,7 +1287,7 @@ ETEXI
         .help       = "request VM to change its memory allocation (in MB)",
         .user_print = monitor_user_noop,
         .mhandler.cmd_async = do_balloon,
-        .async      = 1,
+        .flags      = MONITOR_CMD_ASYNC,
     },
 
 STEXI