Bug 1247884 - virt-xml-validate failed with space char in xml content
virt-xml-validate failed with space char in xml content
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-29 03:29 EDT by Han Han
Modified: 2016-04-26 10:41 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-26 10:41:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Han Han 2015-07-29 03:29:18 EDT
Description of problem:
When there is space character in xml content, the check cmd virt-xml-validate will fail.

Version-Release number of selected component (if applicable):
libvirt-1.2.17-2.el7.x86_64
libvirt-client-1.2.17-2.el7.x86_64
kernel-3.10.0-297.el7.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Create guest with a xml whose <product>aax xcc</product> in <disk>...<disk/> content, for example:
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/fd1.img'/>
<target dev='sda' bus='scsi'/>
<product>aax xcc</product>
<alias name='scsi0-0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
...

2. use virt-xml-validate to check it
# virt-xml-validate guest.xml
Relax-NG validity error : Extra element devices in interleave
guest.xml:1: element domain: Relax-NG validity error : Element domain failed to validate content
guest.xml fails to validate

3. define the domain
# virsh define guest.xml
Domain iso defined from guest.xml

4. delete the space in <product>aax xcc<product/>, and repeat with step 2
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/fd1.img'/>
<target dev='sda' bus='scsi'/>
<product>aaxxcc</product>
<alias name='scsi0-0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
...
# virt-xml-validate guest.xml
guest.xml validates

Actual results:
As step2 and step4 shows


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

Additional info:
The bug can also be  reproduced with <vendor> label in <disk>...</disk>
Comment 2 Cole Robinson 2016-04-26 10:02:18 EDT
I don't want to subject new contributors to just bugs in the schema files :) I've sent a patch upstream for this:

http://www.redhat.com/archives/libvir-list/2016-April/msg01718.html
Comment 3 Cole Robinson 2016-04-26 10:41:48 EDT
commit 600a666ce57803117fc159a88ea1e2cd4ed2fe5e
Author: Cole Robinson <crobinso@redhat.com>
Date:   Fri Apr 15 13:21:27 2016 -0400

    schema: Allow space character in disk vendor/product

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