]> www.infradead.org Git - users/dwmw2/qemu.git/commit
monitor: fdset: Match against O_DIRECT
authorFabiano Rosas <farosas@suse.de>
Mon, 17 Jun 2024 18:57:29 +0000 (15:57 -0300)
committerFabiano Rosas <farosas@suse.de>
Fri, 21 Jun 2024 12:47:22 +0000 (09:47 -0300)
commit99c147e2f53726290bbdde795b6efbb4d9138657
tree04b0fd04ad56fa6a3e1f0f49d7b26b841ca635cf
parent408d295da82103df833f2f0443442d8aed880cb0
monitor: fdset: Match against O_DIRECT

We're about to enable the use of O_DIRECT in the migration code and
due to the alignment restrictions imposed by filesystems we need to
make sure the flag is only used when doing aligned IO.

The migration will do parallel IO to different regions of a file, so
we need to use more than one file descriptor. Those cannot be obtained
by duplicating (dup()) since duplicated file descriptors share the
file status flags, including O_DIRECT. If one migration channel does
unaligned IO while another sets O_DIRECT to do aligned IO, the
filesystem would fail the unaligned operation.

The add-fd QMP command along with the fdset code are specifically
designed to allow the user to pass a set of file descriptors with
different access flags into QEMU to be later fetched by code that
needs to alternate between those flags when doing IO.

Extend the fdset matching to behave the same with the O_DIRECT flag.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
monitor/fds.c