diff options
author | Markus Armbruster <armbru@redhat.com> | 2009-12-07 21:37:15 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-07 16:34:36 -0600 |
commit | 7cdfcfe18f0a9e8603e4a14770a84eb5649521c5 (patch) | |
tree | ed309a3629431999f13a965a0a10cfa874ab47b0 /monitor.c | |
parent | a488be27e5fbfd78e3c7f98706e0c2f6af402061 (diff) |
monitor: convert do_getfd() to QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2071,19 +2071,21 @@ static void do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data) fd = qemu_chr_get_msgfd(mon->chr); if (fd == -1) { - monitor_printf(mon, "getfd: no file descriptor supplied via SCM_RIGHTS\n"); + qemu_error_new(QERR_FD_NOT_SUPPLIED); return; } if (qemu_isdigit(fdname[0])) { - monitor_printf(mon, "getfd: monitor names may not begin with a number\n"); + qemu_error_new(QERR_INVALID_PARAMETER, "fdname"); return; } fd = dup(fd); if (fd == -1) { - monitor_printf(mon, "Failed to dup() file descriptor: %s\n", - strerror(errno)); + if (errno == EMFILE) + qemu_error_new(QERR_TOO_MANY_FILES); + else + qemu_error_new(QERR_UNDEFINED_ERROR); return; } |