aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-06 16:27:48 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 15:41:32 +0400
commit4cda177c6016565dda1f1c3f6cff8ab85ef0d016 (patch)
treecfd222e768c273f912612a65e081833cf5914a03 /qapi
parent78ae0e2613831909f1e553d45fae7925ade6c7f7 (diff)
downloadqemu-4cda177c6016565dda1f1c3f6cff8ab85ef0d016.zip
qemu-4cda177c6016565dda1f1c3f6cff8ab85ef0d016.tar.gz
qemu-4cda177c6016565dda1f1c3f6cff8ab85ef0d016.tar.bz2
qmp: add 'get-win32-socket'
A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command to import it and add it to the monitor fd list, so it can be later used by other commands. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230306122751.2355515-9-marcandre.lureau@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/misc.json31
1 files changed, 31 insertions, 0 deletions
diff --git a/qapi/misc.json b/qapi/misc.json
index f0217cf..5ef6286 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -276,6 +276,37 @@
{ 'command': 'getfd', 'data': {'fdname': 'str'} }
##
+# @get-win32-socket:
+#
+# Add a socket that was duplicated to QEMU process with
+# WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure
+# and assign it a name (the SOCKET is associated with a CRT file
+# descriptor)
+#
+# @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
+#
+# @fdname: file descriptor name
+#
+# Returns: Nothing on success
+#
+# Since: 8.0
+#
+# Notes: If @fdname already exists, the file descriptor assigned to
+# it will be closed and replaced by the received file
+# descriptor.
+#
+# The 'closefd' command can be used to explicitly close the
+# file descriptor when it is no longer needed.
+#
+# Example:
+#
+# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", fdname": "skclient" } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
+
+##
# @closefd:
#
# Close a file descriptor previously passed via SCM rights