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>
diff --git a/hmp-commands.hx b/hmp-commands.hx
index b87c250..bb85ee1 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1486,6 +1486,7 @@
Inject an MCE on the given CPU (x86 only).
ERST
+#ifdef CONFIG_POSIX
{
.name = "getfd",
.args_type = "fdname:s",
@@ -1501,6 +1502,7 @@
mechanism on unix sockets, it is stored using the name *fdname* for
later use by other monitor commands.
ERST
+#endif
{
.name = "closefd",