diff mbox

[08/17] monitor: Convert do_info_name() to QObject

Message ID 1259946695-15784-9-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino Dec. 4, 2009, 5:11 p.m. UTC
Return a QString with the current VM name.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index d3ab2ab..96fde16 100644
--- a/monitor.c
+++ b/monitor.c
@@ -507,10 +507,15 @@  static void do_info_version(Monitor *mon, QObject **ret_data)
     *ret_data = QOBJECT(qstring_from_str(QEMU_VERSION QEMU_PKGVERSION));
 }
 
-static void do_info_name(Monitor *mon)
+/**
+ * do_info_name(): Show VM name
+ *
+ * Return a QString with the current VM name.
+ */
+static void do_info_name(Monitor *mon, QObject **ret_data)
 {
     if (qemu_name)
-        monitor_printf(mon, "%s\n", qemu_name);
+        *ret_data = QOBJECT(qstring_from_str(qemu_name));
 }
 
 /**
@@ -2385,7 +2390,8 @@  static const mon_cmd_t info_cmds[] = {
         .args_type  = "",
         .params     = "",
         .help       = "show the current VM name",
-        .mhandler.info = do_info_name,
+        .user_print = monitor_print_qobject,
+        .mhandler.info_new = do_info_name,
     },
     {
         .name       = "uuid",