Patchwork [03/21] Monitor: Convert do_cont() to cmd_new_ret()

login
register
mail settings
Submitter Luiz Capitulino
Date Feb. 11, 2010, 1:49 a.m.
Message ID <1265853007-27300-4-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/45080/
State New
Headers show

Comments

Luiz Capitulino - Feb. 11, 2010, 1:49 a.m.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c       |    8 ++++++--
 qemu-monitor.hx |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

Patch

diff --git a/monitor.c b/monitor.c
index c1e0af8..cede368 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1148,14 +1148,18 @@  struct bdrv_iterate_context {
 /**
  * do_cont(): Resume emulation.
  */
-static void do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     struct bdrv_iterate_context context = { mon, 0 };
 
     bdrv_iterate(encrypted_bdrv_it, &context);
     /* only resume the vm if all keys are set and valid */
-    if (!context.err)
+    if (!context.err) {
         vm_start();
+        return 0;
+    } else {
+        return -1;
+    }
 }
 
 static void bdrv_key_cb(void *opaque, int err)
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 8e51df0..0eab6db 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -318,7 +318,7 @@  ETEXI
         .params     = "",
         .help       = "resume emulation",
         .user_print = monitor_user_noop,
-        .mhandler.cmd_new = do_cont,
+        .cmd_new_ret = do_cont,
     },
 
 STEXI