<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/io, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/io?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/io?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-07-24T09:39:10Z</updated>
<entry>
<title>crypto: propagate errors from TLS session I/O callbacks</title>
<updated>2024-07-24T09:39:10Z</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2024-03-15T14:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=97f7bf113eb50fcdaf0c73aa2ee01e5355abc073'/>
<id>urn:sha1:97f7bf113eb50fcdaf0c73aa2ee01e5355abc073</id>
<content type='text'>
GNUTLS doesn't know how to perform I/O on anything other than plain
FDs, so the TLS session provides it with some I/O callbacks. The
GNUTLS API design requires these callbacks to return a unix errno
value, which means we're currently loosing the useful QEMU "Error"
object.

This changes the I/O callbacks in QEMU to stash the "Error" object
in the QCryptoTLSSession class, and fetch it when seeing an I/O
error returned from GNUTLS, thus preserving useful error messages.

Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: push error reporting into TLS session I/O APIs</title>
<updated>2024-07-24T09:39:10Z</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2024-03-15T14:07:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=57941c9c86357a6a642f9ee3279d881df4043b6d'/>
<id>urn:sha1:57941c9c86357a6a642f9ee3279d881df4043b6d</id>
<content type='text'>
The current TLS session I/O APIs just return a synthetic errno
value on error, which has been translated from a gnutls error
value. This looses a large amount of valuable information that
distinguishes different scenarios.

Pushing population of the "Error *errp" object into the TLS
session I/O APIs gives more detailed error information.

Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>qio: add support for SO_PEERCRED for socket channel</title>
<updated>2024-07-22T11:47:41Z</updated>
<author>
<name>Anthony Harivel</name>
<email>aharivel@redhat.com</email>
</author>
<published>2024-05-22T15:34:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=95fa0c79a04f3ebebb9f3b68cc05b4b8082b5444'/>
<id>urn:sha1:95fa0c79a04f3ebebb9f3b68cc05b4b8082b5444</id>
<content type='text'>
The function qio_channel_get_peercred() returns a pointer to the
credentials of the peer process connected to this socket.

This credentials structure is defined in &lt;sys/socket.h&gt; as follows:

struct ucred {
	pid_t pid;    /* Process ID of the sending process */
	uid_t uid;    /* User ID of the sending process */
	gid_t gid;    /* Group ID of the sending process */
};

The use of this function is possible only for connected AF_UNIX stream
sockets and for AF_UNIX stream and datagram socket pairs.

On platform other than Linux, the function return 0.

Signed-off-by: Anthony Harivel &lt;aharivel@redhat.com&gt;
Link: https://lore.kernel.org/r/20240522153453.1230389-2-aharivel@redhat.com
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "meson: Propagate gnutls dependency"</title>
<updated>2024-07-03T16:41:26Z</updated>
<author>
<name>Akihiko Odaki</name>
<email>akihiko.odaki@daynix.com</email>
</author>
<published>2024-05-24T08:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=7b1070a7e17cc65c3134350728c85e1d218c3578'/>
<id>urn:sha1:7b1070a7e17cc65c3134350728c85e1d218c3578</id>
<content type='text'>
This reverts commit 3eacf70bb5a83e4775ad8003cbca63a40f70c8c2.

It was only needed because of duplicate objects caused by
declare_dependency(link_whole: ...), and can be dropped now
that meson.build specifies objects and dependencies separately
for the internal dependencies.

Signed-off-by: Akihiko Odaki &lt;akihiko.odaki@daynix.com&gt;
Message-ID: &lt;20240524-objects-v1-2-07cbbe96166b@daynix.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: Stop using qemu_open_old in channel-file</title>
<updated>2024-06-21T12:47:22Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-06-17T18:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=46cec74c1b71973756d8960a305bae1491ae6259'/>
<id>urn:sha1:46cec74c1b71973756d8960a305bae1491ae6259</id>
<content type='text'>
We want to make use of the Error object to report fdset errors from
qemu_open_internal() and passing the error pointer to qemu_open_old()
would require changing all callers. Move the file channel to the new
API instead.

Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
</content>
</entry>
<entry>
<title>qio: Inherit follow_coroutine_ctx across TLS</title>
<updated>2024-05-29T23:30:31Z</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2024-05-18T02:50:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=199e84de1c903ba5aa1f7256310bbc4a20dd930b'/>
<id>urn:sha1:199e84de1c903ba5aa1f7256310bbc4a20dd930b</id>
<content type='text'>
Since qemu 8.2, the combination of NBD + TLS + iothread crashes on an
assertion failure:

qemu-kvm: ../io/channel.c:534: void qio_channel_restart_read(void *): Assertion `qemu_get_current_aio_context() == qemu_coroutine_get_aio_context(co)' failed.

It turns out that when we removed AioContext locking, we did so by
having NBD tell its qio channels that it wanted to opt in to
qio_channel_set_follow_coroutine_ctx(); but while we opted in on the
main channel, we did not opt in on the TLS wrapper channel.
qemu-iotests has coverage of NBD+iothread and NBD+TLS, but apparently
no coverage of NBD+TLS+iothread, or we would have noticed this
regression sooner.  (I'll add that in the next patch)

But while we could manually opt in to the TLS channel in nbd/server.c
(a one-line change), it is more generic if all qio channels that wrap
other channels inherit the follow status, in the same way that they
inherit feature bits.

CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
CC: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
CC: qemu-stable@nongnu.org
Fixes: https://issues.redhat.com/browse/RHEL-34786
Fixes: 06e0f098 ("io: follow coroutine AioContext in qio_channel_yield()", v8.2.0)
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Message-ID: &lt;20240518025246.791593-5-eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: Introduce qio_channel_file_new_dupfd</title>
<updated>2024-03-12T19:22:23Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-03-11T23:33:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=4760cedc61328e47bf7f1fabceb9937facfa4cdd'/>
<id>urn:sha1:4760cedc61328e47bf7f1fabceb9937facfa4cdd</id>
<content type='text'>
Add a new helper function for creating a QIOChannelFile channel with a
duplicated file descriptor. This saves the calling code from having to
do error checking on the dup() call.

Suggested-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
Reviewed-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Link: https://lore.kernel.org/r/20240311233335.17299-2-farosas@suse.de
Signed-off-by: Peter Xu &lt;peterx@redhat.com&gt;
</content>
</entry>
<entry>
<title>migration/multifd: Don't fsync when closing QIOChannelFile</title>
<updated>2024-03-11T18:41:40Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-03-05T19:56:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=61dec060821de5d81a0c5f6b827e4f0282cd92ca'/>
<id>urn:sha1:61dec060821de5d81a0c5f6b827e4f0282cd92ca</id>
<content type='text'>
Commit bc38feddeb ("io: fsync before closing a file channel") added a
fsync/fdatasync at the closing point of the QIOChannelFile to ensure
integrity of the migration stream in case of QEMU crash.

The decision to do the sync at qio_channel_close() was not the best
since that function runs in the main thread and the fsync can cause
QEMU to hang for several minutes, depending on the migration size and
disk speed.

To fix the hang, remove the fsync from qio_channel_file_close().

At this moment, the migration code is the only user of the fsync and
we're taking the tradeoff of not having a sync at all, leaving the
responsibility to the upper layers.

Fixes: bc38feddeb ("io: fsync before closing a file channel")
Reviewed-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
Link: https://lore.kernel.org/r/20240305195629.9922-1-farosas@suse.de
Link: https://lore.kernel.org/r/20240305174332.2553-1-farosas@suse.de
[peterx: add more comment to the qio_channel_close()]
Signed-off-by: Peter Xu &lt;peterx@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: fsync before closing a file channel</title>
<updated>2024-03-01T07:42:04Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@suse.de</email>
</author>
<published>2024-02-29T15:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=c05dfcb7f2c5e39fc47c347de305df4e6afb4fa9'/>
<id>urn:sha1:c05dfcb7f2c5e39fc47c347de305df4e6afb4fa9</id>
<content type='text'>
Make sure the data is flushed to disk before closing file
channels. This is to ensure data is on disk and not lost in the event
of a host crash.

This is currently being implemented to affect the migration code when
migrating to a file, but all QIOChannelFile users should benefit from
the change.

Reviewed-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Acked-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
Link: https://lore.kernel.org/r/20240229153017.2221-6-farosas@suse.de
Signed-off-by: Peter Xu &lt;peterx@redhat.com&gt;
</content>
</entry>
<entry>
<title>io: implement io_pwritev/preadv for QIOChannelFile</title>
<updated>2024-03-01T07:42:04Z</updated>
<author>
<name>Nikolay Borisov</name>
<email>nborisov@suse.com</email>
</author>
<published>2024-02-29T15:29:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=0478b030fa2530cbbfc4d6432e8e39a16d06865b'/>
<id>urn:sha1:0478b030fa2530cbbfc4d6432e8e39a16d06865b</id>
<content type='text'>
The upcoming 'mapped-ram' feature will require qemu to write data to
(and restore from) specific offsets of the migration file.

Add a minimal implementation of pwritev/preadv and expose them via the
io_pwritev and io_preadv interfaces.

Signed-off-by: Nikolay Borisov &lt;nborisov@suse.com&gt;
Reviewed-by: "Daniel P. Berrangé" &lt;berrange@redhat.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@suse.de&gt;
Link: https://lore.kernel.org/r/20240229153017.2221-5-farosas@suse.de
Signed-off-by: Peter Xu &lt;peterx@redhat.com&gt;
</content>
</entry>
</feed>
