aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-09-12 17:54:20 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-04 11:02:57 -0300
commit1fa9a5e4aea36b4d21e42323ae43879c908af576 (patch)
treec9e8bb26d83383227fc37b3686f2365424bc83cc /monitor.c
parent0461d5a699cb8825039400b76839115e35b73d65 (diff)
qapi: Convert query-status
Please, note that the RunState type as defined in sysemu.h and its runstate_as_string() function are being dropped in favor of the RunState type generated by the QAPI. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/monitor.c b/monitor.c
index da729cec20..e68f2e2722 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2550,36 +2550,6 @@ static int do_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
#endif
-static void do_info_status_print(Monitor *mon, const QObject *data)
-{
- QDict *qdict;
- const char *status;
-
- qdict = qobject_to_qdict(data);
-
- monitor_printf(mon, "VM status: ");
- if (qdict_get_bool(qdict, "running")) {
- monitor_printf(mon, "running");
- if (qdict_get_bool(qdict, "singlestep")) {
- monitor_printf(mon, " (single step mode)");
- }
- } else {
- monitor_printf(mon, "paused");
- }
-
- status = qdict_get_str(qdict, "status");
- if (strcmp(status, "paused") && strcmp(status, "running")) {
- monitor_printf(mon, " (%s)", status);
- }
-
- monitor_printf(mon, "\n");
-}
-
-static void do_info_status(Monitor *mon, QObject **ret_data)
-{
- *ret_data = qobject_from_jsonf("{ 'running': %i, 'singlestep': %i, 'status': %s }", runstate_is_running(), singlestep, runstate_as_string());
-}
-
static qemu_acl *find_acl(Monitor *mon, const char *name)
{
qemu_acl *acl = qemu_acl_find(name);
@@ -2979,8 +2949,7 @@ static const mon_cmd_t info_cmds[] = {
.args_type = "",
.params = "",
.help = "show the current VM status (running|paused)",
- .user_print = do_info_status_print,
- .mhandler.info_new = do_info_status,
+ .mhandler.info = hmp_info_status,
},
{
.name = "pcmcia",
@@ -3162,14 +3131,6 @@ static const mon_cmd_t qmp_query_cmds[] = {
.mhandler.info_new = do_pci_info,
},
{
- .name = "status",
- .args_type = "",
- .params = "",
- .help = "show the current VM status (running|paused)",
- .user_print = do_info_status_print,
- .mhandler.info_new = do_info_status,
- },
- {
.name = "mice",
.args_type = "",
.params = "",