From: Jan Kiszka Date: Tue, 15 Jun 2010 22:38:39 +0000 (+0200) Subject: monitor: Establish cmd flags and convert the async tag X-Git-Tag: v0.13.0-rc0~110^2~20 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8ac470c1f945601de9f1f577791c48e95d5340db;hp=3b6dbf277232920a6463fc01d630e4d9dc378ef6;p=qemu.git monitor: Establish cmd flags and convert the async tag As we want to add more flags to monitor commands, convert the only so far existing one accordingly. Signed-off-by: Jan Kiszka Signed-off-by: Luiz Capitulino --- diff --git a/monitor.c b/monitor.c index b375f102b..980e98de0 100644 --- 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", diff --git a/monitor.h b/monitor.h index ea15469f2..9582b9cf1 100644 --- 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, diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 9f62b9486..2af3de6c2 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -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