Hide Forgot
Description of problem: If using relative path (e.g. ./dest) or file name only (e.g. dest) as the destination of drive-mirror, libvirt creates file under / dir After pivoting, we cannot take snapshot and specify snapshot file in other directories. Version-Release number of selected component (if applicable): libvirt-1.3.1-1.fc24_v1.3.1_rc2.x86_64 How reproducible: 100% Steps to Reproduce: 1. mirror and pivot to ./generic.copy # virsh blockcopy generic hda ./generic.copy --wait --verbose Block Copy: [100 %] Now in mirroring phase [root@fedora_yy tmp]# virsh blockjob generic hda Block Copy: [100 %] [root@fedora_yy tmp]# virsh blockjob generic hda --pivot [root@fedora_yy tmp]# virsh domblklist generic Target Source ------------------------------------------------ hda ./generic.copy 2. check where is generic.copy # ll /generic.copy -rw-------. 1 qemu qemu 1848901632 Jan 19 17:25 /generic.copy 3. take external snapshot and specify snapshot file # virsh snapshot-create-as generic --disk-only --no-metadata --diskspec hda,file=/tmp/copy.s1 error: internal error: unable to execute QEMU command 'transaction': Could not open '/tmp/./generic.copy': No such file or directory Actual results: Expected results: Forbid using relative path or file name only as the destination of drive-mirror Additional info:
I sent a patch upstream, converting a relative path to absolute in the virsh handling http://www.redhat.com/archives/libvir-list/2016-April/msg01342.html
(In reply to Cole Robinson from comment #1) > I sent a patch upstream, converting a relative path to absolute in the virsh > handling > > http://www.redhat.com/archives/libvir-list/2016-April/msg01342.html That handling is incorrect. This needs to be fixed in the daemon. I'm picking this up since I'll probably fix it anyways while fixing other aspects of blockcopy.
Fixed upstream: commit 9e9305542eee6700358c6f3c449347cc191eb520 Author: Peter Krempa <pkrempa> Date: Fri Dec 16 18:30:39 2016 +0100 qemu: block copy: Forbid block copy to relative paths Similarly to 29bb066915 forbid paths used with blockjobs to be relative.
1. Start a transient VM: # virsh list --all --transient Id Name State ---------------------------------------------------- 3 RHEL running 2. Try to blockcopy with relative path: # virsh blockcopy RHEL sda xx --wait --verbose --pivot error: invalid argument: absolute path must be used as block copy target # virsh blockcopy RHEL sda ../xx --wait --verbose --pivot error: invalid argument: absolute path must be used as block copy target # virsh blockcopy RHEL sda ./xx --wait --verbose --pivot error: invalid argument: absolute path must be used as block copy target Bug fixed.
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/RHEA-2017:1846