[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/23] monitor: Establish cmd flags and convert the
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 03/23] monitor: Establish cmd flags and convert the async tag |
Date: |
Thu, 1 Jul 2010 16:21:31 -0300 |
From: Jan Kiszka <address@hidden>
As we want to add more flags to monitor commands, convert the only so
far existing one accordingly.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 6 +++---
monitor.h | 3 +++
qemu-monitor.hx | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/monitor.c b/monitor.c
index b375f10..980e98d 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 ea15469..9582b9c 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 9f62b94..2af3de6 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
--
1.7.2.rc0
- [Qemu-devel] [PATCH 00/23][PULL]: QMP/Monitor queue, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 01/23] monitor: Fix leakage during completion processing, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 02/23] monitor: Fix command completion vs. boolean switches, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 03/23] monitor: Establish cmd flags and convert the async tag,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 04/23] QMP: Teach basic capability negotiation to python example, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 05/23] QMP: Fix python helper /wrt long return strings, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 06/23] net: delete QemuOpts when net_client_init() fails., Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 07/23] QMP: Fix error reporting in the async API, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 09/23] QDict: Rename 'err_value', Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 08/23] QError: Enhance QERR_DEVICE_NOT_ACTIVE's user desc, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 11/23] QDict: Introduce functions to retrieve QDictEntry values, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 10/23] QDict: Small terminology change, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 13/23] check-qdict: Introduce test for the new iteration API, Luiz Capitulino, 2010/07/01
- [Qemu-devel] [PATCH 14/23] QDict: Introduce qdict_get_try_bool(), Luiz Capitulino, 2010/07/01