Patchwork [08/21] Monitor: Convert do_closefd() to cmd_new_ret()

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

Comments

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

Patch

diff --git a/monitor.c b/monitor.c
index 9466c63..9338d13 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2447,7 +2447,7 @@  static int do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data)
     return 0;
 }
 
-static void do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     const char *fdname = qdict_get_str(qdict, "fdname");
     mon_fd_t *monfd;
@@ -2461,10 +2461,11 @@  static void do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
         close(monfd->fd);
         qemu_free(monfd->name);
         qemu_free(monfd);
-        return;
+        return 0;
     }
 
     qemu_error_new(QERR_FD_NOT_FOUND, fdname);
+    return -1;
 }
 
 static void do_loadvm(Monitor *mon, const QDict *qdict)
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index e8e2ee1..6e84f76 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -1100,7 +1100,7 @@  ETEXI
         .params     = "closefd name",
         .help       = "close a file descriptor previously passed via SCM rights",
         .user_print = monitor_user_noop,
-        .mhandler.cmd_new = do_closefd,
+        .cmd_new_ret = do_closefd,
     },
 
 STEXI