mirror of https://gitee.com/openkylin/qemu.git
Monitor: Convert do_closefd() to cmd_new_ret()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
6ad3ebd28e
commit
aeb91c1e13
|
@ -2447,7 +2447,7 @@ static int do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
||||||
return 0;
|
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");
|
const char *fdname = qdict_get_str(qdict, "fdname");
|
||||||
mon_fd_t *monfd;
|
mon_fd_t *monfd;
|
||||||
|
@ -2461,10 +2461,11 @@ static void do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
||||||
close(monfd->fd);
|
close(monfd->fd);
|
||||||
qemu_free(monfd->name);
|
qemu_free(monfd->name);
|
||||||
qemu_free(monfd);
|
qemu_free(monfd);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_error_new(QERR_FD_NOT_FOUND, fdname);
|
qemu_error_new(QERR_FD_NOT_FOUND, fdname);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_loadvm(Monitor *mon, const QDict *qdict)
|
static void do_loadvm(Monitor *mon, const QDict *qdict)
|
||||||
|
|
|
@ -1100,7 +1100,7 @@ ETEXI
|
||||||
.params = "closefd name",
|
.params = "closefd name",
|
||||||
.help = "close a file descriptor previously passed via SCM rights",
|
.help = "close a file descriptor previously passed via SCM rights",
|
||||||
.user_print = monitor_user_noop,
|
.user_print = monitor_user_noop,
|
||||||
.mhandler.cmd_new = do_closefd,
|
.cmd_new_ret = do_closefd,
|
||||||
},
|
},
|
||||||
|
|
||||||
STEXI
|
STEXI
|
||||||
|
|
Loading…
Reference in New Issue