]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: domain: Initialize FD passthrough for a virStorageSource before using it
authorPeter Krempa <pkrempa@redhat.com>
Thu, 6 Feb 2025 15:20:45 +0000 (16:20 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 7 Feb 2025 12:52:45 +0000 (13:52 +0100)
commit5830e564bbeb798cccce2988094d1218f6dc5a60
tree784ac722a8624a3da4c419acfe759bf47d00b8f3
parent7a119483a361a3ab814e4e07ccac7b13b0cbfbf7
qemu: domain: Initialize FD passthrough for a virStorageSource before using it

The call to 'qemuBlockStorageSourceNeedsFormatLayer()' bases the
decision also on the state of the passed FD, so we must initialize the
passthrough data via 'qemuDomainPrepareStorageSourceFDs()' before the
aforementioned call.

In the test change it's visible that we didn't add the necessary 'raw'
driver which allows the 'protocol' blockdev to be opened in 'rw' mode so
that qemu picks the proper file descriptior while keeping the device
read-only.

Resolves: https://issues.redhat.com/browse/RHEL-37519
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxmlconfdata/disk-source-fd.x86_64-latest.args