Bug 1247005
| Summary: | special characters in guest disk file name cannot pass virt-xml-validte | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Han Han <hhan> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED ERRATA | QA Contact: | Lili Zhu <lizhu> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | dyuan, hhan, jdenemar, mzhan, pkrempa, rbalakri, xuzhang, yanyang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-2.5.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-01 17:06:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Han Han
2015-07-27 07:05:01 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.
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.
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 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 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 |