Bug 2193315
Summary: | Fail to hot-plug a qcow2 image with fdgroup | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Han Han <hhan> | ||||
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | ||||
libvirt sub component: | General | QA Contact: | Han Han <hhan> | ||||
Status: | CLOSED ERRATA | Docs Contact: | |||||
Severity: | unspecified | ||||||
Priority: | unspecified | CC: | alitke, dzheng, jdenemar, lmen, pkrempa, sgott, virt-maint | ||||
Version: | 9.3 | Keywords: | Triaged | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-9.4.0-1.el9 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2023-11-07 08:31:17 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | 9.4.0 | ||||
Embargoed: | |||||||
Attachments: |
|
Fixed upstream: commit c Author: Peter Krempa <pkrempa> Date: Fri May 5 14:43:17 2023 +0200 qemu: hotplug: Reorder setup of disk backend metadata The regular VM startup code first calls the setup of the disk backing chain as defined in the XML and then calls the function to load the rest of the backing chain from the image metadata. The hotplug code did it the other way around, thus causing a failure when attempting to attach a QCOW2 image via FD passing. Reorder the hotplug code to have the same order. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2193315 Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Ján Tomko <jtomko> v9.3.0-38-g9b8bb536ff PASS on qemu-kvm-8.0.0-1.el9.x86_64 libvirt-v9.3.0-38-g9b8bb536ff + DISK_XML='<disk type='\''file'\'' device='\''disk'\''> <driver name='\''qemu'\'' type='\''qcow2'\''/> <source file='\''/var/lib/libvirt/images/vdc'\'' fdgroup='\''test'\''/> <target dev='\''vdf'\'' bus='\''virtio'\''/> </disk>' + qemu-img create /var/lib/libvirt/images/vdc -f qcow2 10M -o preallocation=falloc Formatting '/var/lib/libvirt/images/vdc', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=falloc compression_type=zl ib size=10485760 lazy_refcounts=off refcount_bits=16 + /root/libvirt/build/tools/virsh create rhel.xml Domain 'rhel' created from rhel.xml + /root/libvirt/build/tools/virsh event --domain rhel --event agent-lifecycle event 'agent-lifecycle' for domain 'rhel': state: 'connected' reason: 'channel event' events received: 1 + exec ++ mktemp + disk_xml_file=/tmp/tmp.5ZsgAppEuB + echo '<disk' 'type='\''file'\''' 'device='\''disk'\''>' '<driver' 'name='\''qemu'\''' 'type='\''qcow2'\''/>' '<source' 'file= '\''/var/lib/libvirt/images/vdc'\''' 'fdgroup='\''test'\''/>' '<target' 'dev='\''vdf'\''' 'bus='\''virtio'\''/>' '</disk>' + /root/libvirt/build/tools/virsh 'dom-fd-associate rhel test 3; attach-device rhel /tmp/tmp.5ZsgAppEuB' Device attached successfully + /root/libvirt/build/tools/virsh dumpxml rhel --xpath //disk <disk type="file" device="disk"> <driver name="qemu" type="qcow2"/> <source file="/var/lib/libvirt/images/rhel.qcow2" index="1"/> <backingStore/> <target dev="vda" bus="virtio"/> <alias name="virtio-disk0"/> <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/> </disk> <disk type="file" device="disk"> <driver name="qemu" type="qcow2"/> <source file="/var/lib/libvirt/images/vdc" fdgroup="test" index="2"/> <backingStore/> <target dev="vdf" bus="virtio"/> <alias name="virtio-disk5"/> <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/> </disk> Since the hot-plug of qcow2 image is common, I think it is better to backport this bug to RHEL9.2. Peter, what do you think of it? (In reply to Han Han from comment #3) > Since the hot-plug of qcow2 image is common, I think it is better to > backport this bug to RHEL9.2. > Peter, what do you think of it? I'll ask whether CNV wants to use the feature in 9.2. If yes I'll ask for a backport, but until then I don't think it's necessary. Hi, Stu, Will CNV use this feature on RHEL9.2? Forwarding the question to Adam, who is more focused in this area. No we have no plans to use this feature at the moment. In CNV, we allow the qemu process to open the disk image file directly. Test PASS on libvirt-9.5.0-0rc1.1.el9.x86_64 libvirt-9.5.0-0rc1.1.el9.x86_64 as comment2 Test PASS on libvirt-9.5.0-5.el9.x86_64 qemu-kvm-8.0.0-11.el9.x86_64 as comment2 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: libvirt security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:6409 |
Created attachment 1962497 [details] reproducing script, domain XML and virtqemud log Description of problem: As subject Version-Release number of selected component (if applicable): libvirt-9.2.0-1.el9 qemu-kvm-8.0.0-1.el9.x86_64 kernel-5.14.0-306.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. Start an VM + /root/libvirt/build/tools/virsh create rhel.xml Domain 'rhel' created from rhel.xml + /root/libvirt/build/tools/virsh event --domain rhel --event agent-lifecycle event 'agent-lifecycle' for domain 'rhel': state: 'connected' reason: 'channel event' events received: 1 2. Open the target qcow2 disk file as fd. Associate the FD with a fdgroup. Attach the disk to the running VM with fdgroup + DISK_XML='<disk type='\''file'\'' device='\''disk'\''> <driver name='\''qemu'\'' type='\''qcow2'\''/> <source file='\''/var/lib/libvirt/images/vdc'\'' fdgroup='\''test'\''/> <target dev='\''vdf'\'' bus='\''virtio'\''/> </disk>' + qemu-img create /var/lib/libvirt/images/vdc -f qcow2 10M -o preallocation=falloc Formatting '/var/lib/libvirt/images/vdc', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=falloc compression_type=zlib size=10485760 lazy_refcounts=off refcount_bits=16 + echo '<disk' 'type='\''file'\''' 'device='\''disk'\''>' '<driver' 'name='\''qemu'\''' 'type='\''qcow2'\''/>' '<source' 'file= '\''/var/lib/libvirt/images/vdc'\''' 'fdgroup='\''test'\''/>' '<target' 'dev='\''vdf'\''' 'bus='\''virtio'\''/>' '</disk>' + /root/libvirt/build/tools/virsh 'dom-fd-associate rhel test 3; attach-device rhel /tmp/tmp.ODdbidggCI' error: Failed to attach device from /tmp/tmp.ODdbidggCI error: internal error: fd passed image source not initialized Actual results: As above Expected results: No error for hot-plug Additional info: Reproduced on v9.1.0 and v9.3.0-32-g4419e74117 Not produced when create the VM with fdgroup of qcow2 disk Not produced for the hot-plug of raw disk with fdgroup For the reproducing script, domain XML and virtqemud log, see the attachment