mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00: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:
@ -192,6 +192,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_POSIX
|
||||
void hmp_getfd(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
const char *fdname = qdict_get_str(qdict, "fdname");
|
||||
@ -200,6 +201,7 @@ void hmp_getfd(Monitor *mon, const QDict *qdict)
|
||||
qmp_getfd(fdname, &err);
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
#endif
|
||||
|
||||
void hmp_closefd(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
|
Reference in New Issue
Block a user