aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/sockets.h
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-06-10 13:07:35 +0300
committerEric Blake <eblake@redhat.com>2021-06-18 10:59:53 -0500
commitc5423704184c43cadd7b3c5ff0aea3925c5509bc (patch)
tree9ec78685f696ba2344ff9686108bdd7d8385106d /include/qemu/sockets.h
parentfb392b548eb4c6c2b2c7689e7fc6b1d2077d4f02 (diff)
downloadqemu-c5423704184c43cadd7b3c5ff0aea3925c5509bc.zip
qemu-c5423704184c43cadd7b3c5ff0aea3925c5509bc.tar.gz
qemu-c5423704184c43cadd7b3c5ff0aea3925c5509bc.tar.bz2
qemu-sockets: introduce socket_address_parse_named_fd()
Add function that transforms named fd inside SocketAddress structure into number representation. This way it may be then used in a context where current monitor is not available. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210610100802.5888-6-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: comment tweak] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/qemu/sockets.h')
-rw-r--r--include/qemu/sockets.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 7d1f813..0c34bf2 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -111,4 +111,15 @@ SocketAddress *socket_remote_address(int fd, Error **errp);
*/
SocketAddress *socket_address_flatten(SocketAddressLegacy *addr);
+/**
+ * socket_address_parse_named_fd:
+ *
+ * Modify @addr, replacing a named fd by its corresponding number.
+ * Needed for callers that plan to pass @addr to a context where the
+ * current monitor is not available.
+ *
+ * Return 0 on success.
+ */
+int socket_address_parse_named_fd(SocketAddress *addr, Error **errp);
+
#endif /* QEMU_SOCKETS_H */