Patchwork [04/21] Monitor: Convert do_eject() to cmd_new_ret()

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

Comments

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

Patch

diff --git a/monitor.c b/monitor.c
index cede368..e960c38 100644
--- a/monitor.c
+++ b/monitor.c
@@ -989,7 +989,7 @@  static int eject_device(Monitor *mon, BlockDriverState *bs, int force)
     return 0;
 }
 
-static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     BlockDriverState *bs;
     int force = qdict_get_int(qdict, "force");
@@ -998,9 +998,9 @@  static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
     bs = bdrv_find(filename);
     if (!bs) {
         qemu_error_new(QERR_DEVICE_NOT_FOUND, filename);
-        return;
+        return -1;
     }
-    eject_device(mon, bs, force);
+    return eject_device(mon, bs, force);
 }
 
 static void do_block_set_passwd(Monitor *mon, const QDict *qdict,
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 0eab6db..c1bd773 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -138,7 +138,7 @@  ETEXI
         .params     = "[-f] device",
         .help       = "eject a removable medium (use -f to force it)",
         .user_print = monitor_user_noop,
-        .mhandler.cmd_new = do_eject,
+        .cmd_new_ret = do_eject,
     },
 
 STEXI