Bug 1798366 - Fail to attach disk with copy_on_read on
Summary: Fail to attach disk with copy_on_read on
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Peter Krempa
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-05 07:28 UTC by Han Han
Modified: 2020-05-05 09:58 UTC (History)
7 users (show)

Fixed In Version: libvirt-6.0.0-6.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:57:11 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2017 0 None None None 2020-05-05 09:58:34 UTC

Description Han Han 2020-02-05 07:28:44 UTC
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:

Comment 2 Peter Krempa 2020-02-19 14:12:28 UTC
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

Comment 6 Meina Li 2020-03-09 03:09:29 UTC
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.

Comment 8 errata-xmlrpc 2020-05-05 09:57:11 UTC
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


Note You need to log in before you can comment on or make changes to this bug.