<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/include/io, branch master</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/include/io?h=master</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/include/io?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-10-12T15:22:01+00:00</updated>
<entry>
<title>io/command: implement support for win32</title>
<updated>2022-10-12T15:22:01+00:00</updated>
<author>
<name>Marc-André Lureau</name>
</author>
<published>2022-10-06T11:36:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=ec5b6c9c5de985769a3d816b85cfe707a2decb93'/>
<id>urn:sha1:ec5b6c9c5de985769a3d816b85cfe707a2decb93</id>
<content type='text'>
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 &lt;marcandre.lureau@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;20221006113657.2656108-6-marcandre.lureau@redhat.com&gt;
</content>
</entry>
<entry>
<title>io/command: use glib GSpawn, instead of open-coding fork/exec</title>
<updated>2022-10-12T15:22:01+00:00</updated>
<author>
<name>Marc-André Lureau</name>
</author>
<published>2022-10-06T11:36:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=a95570e3e4d61a7c8e527e512246665c51caa6f4'/>
<id>urn:sha1:a95570e3e4d61a7c8e527e512246665c51caa6f4</id>
<content type='text'>
Simplify qio_channel_command_new_spawn() with GSpawn API. This will
allow to build for WIN32 in the following patches.

As pointed out by Daniel Berrangé: there is a change in semantics here
too. The current code only touches stdin/stdout/stderr. Any other FDs
which do NOT have O_CLOEXEC set will be inherited. With the new code,
all FDs except stdin/out/err will be explicitly closed, because we don't
set the flag G_SPAWN_LEAVE_DESCRIPTORS_OPEN. The only place we use
QIOChannelCommand today is the migration exec: protocol, and that is
only declared to use stdin/stdout.

Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20221006113657.2656108-5-marcandre.lureau@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: add a QIOChannelNull equivalent to /dev/null</title>
<updated>2022-06-22T17:11:21+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
</author>
<published>2022-06-20T11:01:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=87e42764490896e66ab8a3c93280384689b0acb4'/>
<id>urn:sha1:87e42764490896e66ab8a3c93280384689b0acb4</id>
<content type='text'>
This is for code which needs a portable equivalent to a QIOChannelFile
connected to /dev/null.

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Reviewed-by: Juan Quintela &lt;quintela@redhat.com&gt;
Signed-off-by: Juan Quintela &lt;quintela@redhat.com&gt;
Signed-off-by: Dr. David Alan Gilbert &lt;dgilbert@redhat.com&gt;
</content>
</entry>
<entry>
<title>QIOChannelSocket: Implement io_writev zero copy flag &amp; io_flush for CONFIG_LINUX</title>
<updated>2022-05-16T12:56:24+00:00</updated>
<author>
<name>Leonardo Bras</name>
</author>
<published>2022-05-13T06:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=2bc58ffc2926a4efdd03edfb5909861fefc68c3d'/>
<id>urn:sha1:2bc58ffc2926a4efdd03edfb5909861fefc68c3d</id>
<content type='text'>
For CONFIG_LINUX, implement the new zero copy flag and the optional callback
io_flush on QIOChannelSocket, but enables it only when MSG_ZEROCOPY
feature is available in the host kernel, which is checked on
qio_channel_socket_connect_sync()

qio_channel_socket_flush() was implemented by counting how many times
sendmsg(...,MSG_ZEROCOPY) was successfully called, and then reading the
socket's error queue, in order to find how many of them finished sending.
Flush will loop until those counters are the same, or until some error occurs.

Notes on using writev() with QIO_CHANNEL_WRITE_FLAG_ZERO_COPY:
1: Buffer
- As MSG_ZEROCOPY tells the kernel to use the same user buffer to avoid copying,
some caution is necessary to avoid overwriting any buffer before it's sent.
If something like this happen, a newer version of the buffer may be sent instead.
- If this is a problem, it's recommended to call qio_channel_flush() before freeing
or re-using the buffer.

2: Locked memory
- When using MSG_ZERCOCOPY, the buffer memory will be locked after queued, and
unlocked after it's sent.
- Depending on the size of each buffer, and how often it's sent, it may require
a larger amount of locked memory than usually available to non-root user.
- If the required amount of locked memory is not available, writev_zero_copy
will return an error, which can abort an operation like migration,
- Because of this, when an user code wants to add zero copy as a feature, it
requires a mechanism to disable it, so it can still be accessible to less
privileged users.

Signed-off-by: Leonardo Bras &lt;leobras@redhat.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Reviewed-by: Juan Quintela &lt;quintela@redhat.com&gt;
Message-Id: &lt;20220513062836.965425-4-leobras@redhat.com&gt;
Signed-off-by: Dr. David Alan Gilbert &lt;dgilbert@redhat.com&gt;
</content>
</entry>
<entry>
<title>QIOChannel: Add flags on io_writev and introduce io_flush callback</title>
<updated>2022-05-16T12:56:24+00:00</updated>
<author>
<name>Leonardo Bras</name>
</author>
<published>2022-05-13T06:28:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad'/>
<id>urn:sha1:b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad</id>
<content type='text'>
Add flags to io_writev and introduce io_flush as optional callback to
QIOChannelClass, allowing the implementation of zero copy writes by
subclasses.

How to use them:
- Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY),
- Wait write completion with qio_channel_flush().

Notes:
As some zero copy write implementations work asynchronously, it's
recommended to keep the write buffer untouched until the return of
qio_channel_flush(), to avoid the risk of sending an updated buffer
instead of the buffer state during write.

As io_flush callback is optional, if a subclass does not implement it, then:
- io_flush will return 0 without changing anything.

Also, some functions like qio_channel_writev_full_all() were adapted to
receive a flag parameter. That allows shared code between zero copy and
non-zero copy writev, and also an easier implementation on new flags.

Signed-off-by: Leonardo Bras &lt;leobras@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Reviewed-by: Juan Quintela &lt;quintela@redhat.com&gt;
Message-Id: &lt;20220513062836.965425-3-leobras@redhat.com&gt;
Signed-off-by: Dr. David Alan Gilbert &lt;dgilbert@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: make qio_channel_command_new_pid() static</title>
<updated>2022-05-03T11:47:59+00:00</updated>
<author>
<name>Marc-André Lureau</name>
</author>
<published>2022-04-25T08:53:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=05e50e8fe5fed707653e1e5e2f2871f253a70452'/>
<id>urn:sha1:05e50e8fe5fed707653e1e5e2f2871f253a70452</id>
<content type='text'>
The function isn't used outside of qio_channel_command_new_spawn(),
which is !win32-specific.

Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>io: add qio_channel_readv_full_all_eof &amp; qio_channel_readv_full_all helpers</title>
<updated>2021-02-10T09:23:28+00:00</updated>
<author>
<name>Elena Ufimtseva</name>
</author>
<published>2021-01-29T16:46:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=bebab91ebdfc591f8793a9a17370df1bfbe8b2ca'/>
<id>urn:sha1:bebab91ebdfc591f8793a9a17370df1bfbe8b2ca</id>
<content type='text'>
Adds qio_channel_readv_full_all_eof() and qio_channel_readv_full_all()
to read both data and FDs. Refactors existing code to use these helpers.

Signed-off-by: Elena Ufimtseva &lt;elena.ufimtseva@oracle.com&gt;
Signed-off-by: John G Johnson &lt;john.g.johnson@oracle.com&gt;
Signed-off-by: Jagannathan Raman &lt;jag.raman@oracle.com&gt;
Acked-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-id: b059c4cc0fb741e794d644c144cc21372cad877d.1611938319.git.jag.raman@oracle.com
Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: add qio_channel_writev_full_all helper</title>
<updated>2021-02-10T09:23:28+00:00</updated>
<author>
<name>Elena Ufimtseva</name>
</author>
<published>2021-01-29T16:46:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=bfa42387505168782ba7b339d0b13c23648e6207'/>
<id>urn:sha1:bfa42387505168782ba7b339d0b13c23648e6207</id>
<content type='text'>
Adds qio_channel_writev_full_all() to transmit both data and FDs.
Refactors existing code to use this helper.

Signed-off-by: Elena Ufimtseva &lt;elena.ufimtseva@oracle.com&gt;
Signed-off-by: John G Johnson &lt;john.g.johnson@oracle.com&gt;
Signed-off-by: Jagannathan Raman &lt;jag.raman@oracle.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Acked-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-id: 480fbf1fe4152495d60596c9b665124549b426a5.1611938319.git.jag.raman@oracle.com
Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown</title>
<updated>2021-01-13T09:21:17+00:00</updated>
<author>
<name>Lukas Straub</name>
</author>
<published>2020-12-28T15:08:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=8659f317d3303092d8e534eeefd160aa5ead9aab'/>
<id>urn:sha1:8659f317d3303092d8e534eeefd160aa5ead9aab</id>
<content type='text'>
Migration and yank code assume that qio_channel_shutdown is thread
-safe and can be called from qmp oob handler. Document this after
checking the code.

Signed-off-by: Lukas Straub &lt;lukasstraub2@web.de&gt;
Acked-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;32b8c27e256da043f0f00db05bd7ab8fbc506070.1609167865.git.lukasstraub2@web.de&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: Fix Lesser GPL version number</title>
<updated>2020-10-27T15:48:49+00:00</updated>
<author>
<name>Chetan Pant</name>
</author>
<published>2020-10-14T13:40:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c8198bd5f991f5674960bf6a7754614f69f71620'/>
<id>urn:sha1:c8198bd5f991f5674960bf6a7754614f69f71620</id>
<content type='text'>
There is no "version 2" of the "Lesser" General Public License.
It is either "GPL version 2.0" or "Lesser GPL version 2.1".
This patch replaces all occurrences of "Lesser GPL version 2" with
"Lesser GPL version 2.1" in comment section.

Signed-off-by: Chetan Pant &lt;chetan4windows@gmail.com&gt;
Acked-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-Id: &lt;20201014134033.14095-1-chetan4windows@gmail.com&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
</feed>
