From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, "Laurent Vivier" <lvivier@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH 08/10] qmp: add 'get-win32-socket'
Date: Mon, 9 Jan 2023 12:20:48 +0000 [thread overview]
Message-ID: <Y7wGoMdJpfIkEDwx@redhat.com> (raw)
In-Reply-To: <20230103110814.3726795-9-marcandre.lureau@redhat.com>
On Tue, Jan 03, 2023 at 03:08:12PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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.
>
> Note that we actually store the SOCKET in the FD list, appropriate care
> must now be taken to use the correct socket functions (similar approach
> is taken by our io/ code and in glib, this is internal and shouldn't
> affect the QEMU/QMP users)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> qapi/misc.json | 32 ++++++++++++++++++++++
> monitor/misc.c | 74 ++++++++++++++++++++++++++++++++++++++++----------
> 2 files changed, 91 insertions(+), 15 deletions(-)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 27ef5a2b20..a19dd78fab 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -272,6 +272,38 @@
> ##
> { '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. A SOCKET
> +# is considered as a kind of "file descriptor" by QMP clients, for historical
> +# reasons and simplicity, although QEMU takes care to use socket functions
> +# appropriately.
> +#
> +# @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' }
IIUC, this is needed because 'getfd' doesn't work on Windows ?
Can't we just implement getfd on Windows, using this WSAPROTOCOL_INFOW
structure passing, or are you anticipating that future Windows make get
normal 'getfd' support ?
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-01-09 12:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 11:08 [PATCH 00/10] Various win32 fixes & new 'get-win32-socket' QMP command marcandre.lureau
2023-01-03 11:08 ` [PATCH 01/10] ccid-card-emulated: fix cast warning/error marcandre.lureau
2023-01-03 12:05 ` Thomas Huth
2023-01-16 17:46 ` Laurent Vivier
2023-01-03 11:08 ` [PATCH 02/10] tests: fix path separator, use g_build_filename() marcandre.lureau
2023-01-03 12:06 ` Thomas Huth
2023-01-03 12:37 ` Philippe Mathieu-Daudé
2023-01-03 11:08 ` [PATCH 03/10] tests: fix test-io-channel-command on win32 marcandre.lureau
2023-01-03 11:08 ` [PATCH 04/10] tests/docker: fix a win32 error due to portability marcandre.lureau
2023-01-03 12:38 ` Philippe Mathieu-Daudé
2023-01-03 11:08 ` [PATCH 05/10] tests/readconfig: spice doesn't support unix socket on windows yet marcandre.lureau
2023-01-03 12:09 ` Thomas Huth
2023-01-03 11:08 ` [PATCH 06/10] osdep: implement qemu_socketpair() for win32 marcandre.lureau
2023-01-03 11:08 ` [PATCH 07/10] qmp: 'add_client' actually expects sockets marcandre.lureau
2023-01-03 12:42 ` Philippe Mathieu-Daudé
2023-01-03 11:08 ` [PATCH 08/10] qmp: add 'get-win32-socket' marcandre.lureau
2023-01-09 12:20 ` Daniel P. Berrangé [this message]
2023-01-09 12:28 ` Marc-André Lureau
2023-01-03 11:08 ` [PATCH 09/10] libqtest: make qtest_qmp_add_client work on win32 marcandre.lureau
2023-01-03 12:10 ` Thomas Huth
2023-01-03 11:08 ` [PATCH 10/10] qtest: enable vnc-display test " marcandre.lureau
2023-01-03 12:11 ` Thomas Huth
2023-01-03 12:46 ` [PATCH 00/10] Various win32 fixes & new 'get-win32-socket' QMP command Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7wGoMdJpfIkEDwx@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=bleal@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).