mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
monitor: restrict command getfd to POSIX hosts
Currently, the function will simply fail if ancillary fds are not provided, for ex on unsupported platforms. This changes the failure from: {"error": {"class": "GenericError", "desc": "No file descriptor supplied via SCM_RIGHTS"}} to: {"error": {"class": "CommandNotFound", "desc": "The command getfd has not been found"}} Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
f02b2c1917
commit
4bf21c7f74
4 changed files with 7 additions and 1 deletions
|
@ -98,6 +98,7 @@ static bool monitor_add_fd(Monitor *mon, int fd, const char *fdname, Error **err
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_POSIX
|
||||
void qmp_getfd(const char *fdname, Error **errp)
|
||||
{
|
||||
Monitor *cur_mon = monitor_cur();
|
||||
|
@ -111,6 +112,7 @@ void qmp_getfd(const char *fdname, Error **errp)
|
|||
|
||||
monitor_add_fd(cur_mon, fd, fdname, errp);
|
||||
}
|
||||
#endif
|
||||
|
||||
void qmp_closefd(const char *fdname, Error **errp)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue