Description of problem: As subject Version-Release number of selected component (if applicable): qemu-kvm-4.2.0-8.module+el8.2.0+5607+dc756904.x86_64 libvirt v6.0.0-307-g4ab2120f3b How reproducible: 100% Steps to Reproduce: See https://bugzilla.redhat.com/show_bug.cgi?id=1792195#c4 Actual results: Expected results: Additional info:
https://www.redhat.com/archives/libvir-list/2020-February/msg00259.html
Fixed upstream by: b71cf8726c qemu: hotplug: Fix handling of the 'copy-on-read' layer with blockdev db57e9daf5 qemuMonitorBlockdevAdd: Take double pointer argument a592d589aa qemuMonitorJSONBlockdevDel: Refactor cleanup 643294110c qemuMonitorJSONBlockdevAdd: Refactor cleanup
Verified Version: libvirt-6.0.0-7.el8.x86_64 qemu-kvm-4.2.0-12.module+el8.2.0+5858+afd073bc.x86_64 Verified Steps: Prepare a disk xml for the following test: # cat disk.xml <disk type='file' device='disk'> <driver name='qemu' type='qcow2' copy_on_read='on'/> <source file='/var/lib/libvirt/images/test.qcow2'/> <target dev='vdb' bus='virtio'/> </disk> SC1: Hotplug disk with copy_on_read on 1. Attach the disk to the guest and check the result. # virsh attach-device lmn1 disk.xml Device attached successfully # virsh dumpxml lmn1 | awk '/<disk/,/<\/disk/' … <disk type='file' device='disk'> <driver name='qemu' type='qcow2' copy_on_read='on'/> <source file='/var/lib/libvirt/images/test.qcow2' index='2'/> <backingStore/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </disk> 2. Detach the disk from the guest. # virsh detach-device lmn1 disk.xml Device detached successfully # virsh domblklist lmn1 Target Source --------------------------------------------- vda /var/lib/libvirt/images/lmn.qcow2 SC2: Cold plug with copy_on_read on 1. Make sure the guest is shut off. 2. Cold plug the disk to the guest, start the guest and check the result. # virsh attach-device lmn1 disk.xml --config Device attached successfully # virsh start lmn1 Domain lmn1 started # virsh dumpxml lmn1 | awk '/<disk/,/<\/disk/' … <disk type='file' device='disk'> <driver name='qemu' type='qcow2' copy_on_read='on'/> <source file='/var/lib/libvirt/images/test.qcow2' index='1'/> <backingStore/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </disk> # ps -ef | grep qemu | grep copy-on-read … -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/test.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null} -blockdev {"driver":"copy-on-read","node-name":"libvirt-CoR-vdb","file":"libvirt-1-format"} 3. Detach the disk from the guest. # virsh detach-device lmn1 disk.xml --config Device detached successfully # virsh destroy lmn1; virsh start lmn1 Domain lmn1 destroyed Domain lmn1 started # virsh domblklist lmn1 Target Source --------------------------------------------- vda /var/lib/libvirt/images/lmn.qcow2 So move this bug to be verified.
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, 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/RHBA-2020:2017