Patchwork Monitor: Convert do_screen_dump() to QObject

login
register
mail settings
Submitter Luiz Capitulino
Date March 31, 2010, 8:12 p.m.
Message ID <20100331171226.11f8e3c2@redhat.com>
Download mbox | patch
Permalink /patch/49177/
State New
Headers show

Comments

Luiz Capitulino - March 31, 2010, 8:12 p.m.
Trivial, as it never fails, doesn't have output nor return
any data.

Note that it's also available under QMP, as kvm-autotest
needs this.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c       |    3 ++-
 qemu-monitor.hx |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Markus Armbruster - April 1, 2010, 8:53 a.m.
Luiz Capitulino <lcapitulino@redhat.com> writes:

> Trivial, as it never fails, doesn't have output nor return
> any data.
>
> Note that it's also available under QMP, as kvm-autotest
> needs this.
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>

Looks good.

Aside: screen dump fails silently, but that's outside the scope of QMP
conversion.

Patch

diff --git a/monitor.c b/monitor.c
index 389485d..d2d2504 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1163,9 +1163,10 @@  static int do_change(Monitor *mon, const QDict *qdict, QObject **ret_data)
     return ret;
 }
 
-static void do_screen_dump(Monitor *mon, const QDict *qdict)
+static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     vga_hw_screen_dump(qdict_get_str(qdict, "filename"));
+    return 0;
 }
 
 static void do_logfile(Monitor *mon, const QDict *qdict)
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 62fa346..5ea5748 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -199,7 +199,8 @@  ETEXI
         .args_type  = "filename:F",
         .params     = "filename",
         .help       = "save screen into PPM image 'filename'",
-        .mhandler.cmd = do_screen_dump,
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_screen_dump,
     },
 
 STEXI