RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1300177 - Forbid using relative path or file name only as the destination of drive-mirror
Summary: Forbid using relative path or file name only as the destination of drive-mirror
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-20 07:22 UTC by Yang Yang
Modified: 2017-08-01 23:51 UTC (History)
8 users (show)

Fixed In Version: libvirt-3.0.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:09:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Yang Yang 2016-01-20 07:22:42 UTC
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:

Comment 1 Cole Robinson 2016-04-20 18:01:38 UTC
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

Comment 2 Peter Krempa 2016-04-21 08:13:01 UTC
(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.

Comment 3 Peter Krempa 2016-12-19 08:03:15 UTC
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.

Comment 5 Han Han 2017-04-18 10:42:57 UTC
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.

Comment 6 errata-xmlrpc 2017-08-01 17:09:12 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/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-01 23:51:16 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/RHEA-2017:1846


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