diff options
author | Marc-André Lureau | 2022-10-06 13:36:56 +0200 |
---|---|---|
committer | Marc-André Lureau | 2022-10-12 17:22:01 +0200 |
commit | ec5b6c9c5de985769a3d816b85cfe707a2decb93 (patch) | |
tree | 50610752e1d173c6a86a26631c4782cb3ffe99b5 /include | |
parent | io/command: use glib GSpawn, instead of open-coding fork/exec (diff) | |
download | qemu-ec5b6c9c5de985769a3d816b85cfe707a2decb93.tar.gz qemu-ec5b6c9c5de985769a3d816b85cfe707a2decb93.tar.xz qemu-ec5b6c9c5de985769a3d816b85cfe707a2decb93.zip |
io/command: implement support for win32
The initial implementation was changing the pipe state created by GLib
to PIPE_NOWAIT, but it turns out it doesn't work (read/write returns an
error). Since reading may return less than the requested amount, it
seems to be non-blocking already. However, the IO operation may block
until the FD is ready, I can't find good sources of information, to be
safe we can just poll for readiness before.
Alternatively, we could setup the FDs ourself, and use UNIX sockets on
Windows, which can be used in blocking/non-blocking mode. I haven't
tried it, as I am not sure it is necessary.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221006113657.2656108-6-marcandre.lureau@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/io/channel-command.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/io/channel-command.h b/include/io/channel-command.h index 8dc58273c0..98934e6d9e 100644 --- a/include/io/channel-command.h +++ b/include/io/channel-command.h @@ -42,6 +42,9 @@ struct QIOChannelCommand { int writefd; int readfd; GPid pid; +#ifdef WIN32 + bool blocking; +#endif }; |