Created attachment 1640591 [details] libvirtd log Description of problem: Cannot blockcopy to a block device as target Version-Release number of selected component (if applicable): libvirt-5.9.0-4.module+el8.2.0+4836+a8e32ad7.x86_64 How reproducible: 100% Steps to Reproduce: 1. having a block device on host (/dev/sda here) # lsscsi [2:0:0:0] disk LIO-ORG device.logical- 4.0 /dev/sda # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1000M 0 disk 2. having a transient running vm # virsh list ... -------------------------------- 1 avocado-vt-vm1 running # virsh domblklist avocado-vt-vm1 ... ---------------------------------------------------------------------- vda /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2 # virsh undefine avocado-vt-vm1 3. do block copy, error happened # virsh blockcopy avocado-vt-vm1 vda /dev/sda --blockdev Error:unable to verify existence of block copy target: Function not implemented Actual results: block copy failed Expected results: no failure Additional info: A regression failure on rhel8.2.0, not reproduced on rhel8.1.0 libvirtd log as attachment
The code path for the block device forgot to initialize the virStorageSource and thus the subsequent API uses fail for it.
Fixed upstream by: commit 6519c1b55413b8d8d32d0cfe97ba99cb21e8ff8c (HEAD -> master, origin/master, origin/HEAD) Author: Peter Krempa <pkrempa> Date: Fri Nov 29 14:33:05 2019 +0100 qemu: blockcopy: Fix conditions when virStorageSource should be initialized Commit 4b58fdf280a which enabled block copy also for network destinations needed to limit when the 'mirror' storage source is initialized in cases when we e.g. don't have an appropriate backend. Limiting it just to virStorageFileSupportsCreate is too restrictive as for example we can't precreate block devices and thus wouldn't initialize the 'mirror' but since it's a local source we'd try to examine it. This would fail since it wouldn't be initialized. Fix it by introducing a more granular check whether certain operations are supported and fix the check interlocks. v5.10.0-rc2-7-g6519c1b554
Verified with libvirt-6.0.0-1 [root@dell-per730-67 ~]# rpm -qa | grep libvirt-6 libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64 1. Having a local scsi disk (.libvirt-ci-venv-ci-runtest-jcaFve) [root@dell-per730-67 ~]# lsblk ... sdb 8:16 0 9.8G 0 disk 2. Do blockcopy of transient vm's vda to local disk sdb (.libvirt-ci-venv-ci-runtest-jcaFve) [root@dell-per730-67 ~]# virsh blockcopy vm1 vda /dev/sdb --blockdev Block Copy started [root@dell-per730-67 ~]# virsh blockjob vm1 vda Block Copy: [100 %] 3. Do blockjob --pivot and check the /dev/sdb copied successfully [root@dell-per730-67 ~]# virsh blockjob vm1 vda --pivot [root@dell-per730-67 ~]# virsh domblklist vm1 Target Source -------------------- vda /dev/sdb [root@dell-per730-67 ~]# virsh console vm1 Connected to domain vm1 Escape character is ^] Red Hat Enterprise Linux 8.2 Beta (Ootpa) Kernel 4.18.0-167.el8.x86_64 on an x86_64 localhost login: root Password: Last login: Sun Jan 19 15:10:09 from 192.168.122.1 [root@localhost ~]#
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