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 1247005 - special characters in guest disk file name cannot pass virt-xml-validte
Summary: special characters in guest disk file name cannot pass virt-xml-validte
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-27 07:05 UTC by Han Han
Modified: 2017-09-25 03:17 UTC (History)
8 users (show)

Fixed In Version: libvirt-2.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:06:41 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 Han Han 2015-07-27 07:05:01 UTC
Description of problem:
some special chars like ,* in guest disk file name cannot pass virt-xml-validte,
but guest can be successfully created and ran.


Version-Release number of selected component (if applicable):
libvirt-1.2.17-2.el7.x86_64
qemu-kvm-rhev-2.3.0-12.el7.x86_64
kernel-3.10.0-297.el7.x86_64 


How reproducible:
100%


Steps to Reproduce:
1. Create gusest with xml like following
...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/tt,tt.qcow2**'/>
<target dev='vda' bus='virtio'/>
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
...
note that the guest disk file name is tt,tt.qcow2** 

2. start the guest
# virsh create guest.xml
Domain guest created from guest.xml 

3. verify the xml
# virt-xml-validate guest.xml
Relax-NG validity error : Extra element devices in interleave
guest.xml:30: element devices: Relax-NG validity error : Element domain failed to validate content
guest.xml fails to validate


Actual results:
As step2-3 shows 


Expected results:
In step3, should output:
guest.xml validates

Additional info:

Comment 2 Peter Krempa 2016-10-07 11:18:17 UTC
Fixed upstream:

commit c4b92f1a8a9cb64a2c4a9f0ed899ed8a7d95d935
Author: Michal Privoznik <mprivozn>
Date:   Fri Aug 12 10:52:30 2016 +0200

    schema: Don't validate paths
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1353296
    
    On UNIX like systems there are no constraints on what characters
    can be in file/dir names (except for NULL, obviously). Moreover,
    some values that we think of as paths (e.g. disk source) are not
    necessarily paths at all. For instance, some hypervisors take
    that as an arbitrary identifier and corresponding file is then
    looked up by hypervisor in its table. Instead of trying to fix
    our regular expressions (and forgetting to include yet another
    character there), lets drop the validation completely.

Comment 4 Lili Zhu 2017-06-18 15:58:22 UTC
Reproduce the bug with build libvirt-2.0.0-10.el7.x86_64
Steps to produce:
1. prepare a xml file as the following:
....
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/rhel7.4\.img**'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
...
Note: the path contains some special chars, such as "*", "/"

2. 
# virsh define rhel7.4v2.xml.dump 
Domain rhel7.4v2 defined from rhel7.4v2.xml.dump

[root@libvirtd images]# virsh start rhel7.4v2
Domain rhel7.4v2 started

3. 
# virt-xml-validate rhel7.4v2.xml.dump 
Relax-NG validity error : Extra element devices in interleave
rhel7.4v2.xml.dump:31: element devices: Relax-NG validity error : Element domain failed to validate content
rhel7.4v2.xml.dump fails to validate


Verify the bug with build libvirt-3.2.0-10.el7.x86_64
Steps to verify:
The first two steps are the same with the steps above in the reproducing part.
3.
# virt-xml-validate rhel7.4v2.xml.dump 
rhel7.4v2.xml.dump validates

As the result match the expectation, mark the bug as verified.

Comment 5 errata-xmlrpc 2017-08-01 17:06:41 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 6 errata-xmlrpc 2017-08-01 23:48:45 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-02 01:25:04 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.