qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 15/25] Monitor: Convert do_info_status_print() into


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 15/25] Monitor: Convert do_info_status_print() into do_info_status()
Date: Mon, 6 Dec 2010 16:24:02 -0200

The new handler directly calls qmp_query_status() to gather
data and then prints it. This change allows us to drop the
user_print callback.

Signed-off-by: Luiz Capitulino <address@hidden>
---
 monitor.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/monitor.c b/monitor.c
index 731cb35..445c73a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2143,10 +2143,12 @@ static void qmp_query_status(Monitor *mon, QObject 
**ret_data)
                                     vm_running, singlestep);
 }
 
-static void do_info_status_print(Monitor *mon, const QObject *data)
+static void do_info_status(Monitor *mon)
 {
     QDict *qdict;
+    QObject *data;
 
+    qmp_query_status(NULL, &data);
     qdict = qobject_to_qdict(data);
 
     monitor_printf(mon, "VM status: ");
@@ -2160,6 +2162,7 @@ static void do_info_status_print(Monitor *mon, const 
QObject *data)
     }
 
     monitor_printf(mon, "\n");
+    qobject_decref(data);
 }
 
 static qemu_acl *find_acl(Monitor *mon, const char *name)
@@ -2543,8 +2546,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 = qmp_query_status,
+        .mhandler.info = do_info_status,
     },
     {
         .name       = "pcmcia",
-- 
1.7.3.3.398.g0b0cd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]