Bug 817252 - virt-xml-validate should give error info for "\/" as the name of a guest in xml
virt-xml-validate should give error info for "\/" as the name of a guest in xml
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-28 05:59 EDT by EricLee
Modified: 2012-05-01 23:01 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-30 04:32:33 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 EricLee 2012-04-28 05:59:15 EDT
Description of problem:
virt-xml-validate should give error info for "\/" as the name of a guest in xml

Version-Release number of selected component (if applicable):
libvirt-0.9.10-14.el6

How reproducible:
100%

Steps to Reproduce:
1.# cat template.xml
<domain type='kvm'>
<name>\/</name>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='rhel6.1.0'>hvm</type>
<boot dev='hd'/>
</os>

..snip...

</domain>

2.# virt-xml-validate template.xml
template.xml validates

3.But when define the guest:
# virsh define template.xml
error: Failed to define domain from template.xml
error: cannot create file '/etc/libvirt/qemu/\/.xml.new': No such file or directory

Actual results:
As above

Expected results:
virt-xml-validate should give the error info like "<" or "&", before define.

Another issue:
   # cat /tmp/xp.xml |grep name\>
      <name>/</name>

   # virsh define xp.xml
      Domain / defined from xp.xml

   # virsh list --all
      Id Name State
      ----------------------------------------------------
      - / shut off

You can define with "/" and "./",but you can only get the ".xml" in /etc/libvirt/qemu/

Additional info:
And for "&":
# virt-xml-validate template.xml
template.xml:2: parser error : xmlParseEntityRef: no name
<name>&</name>
     ^

And for "<":
# virt-xml-validate template.xml
/usr/bin/virt-xml-validate: cannot determine schema type for template.xml
Comment 2 Daniel Berrange 2012-04-30 04:32:33 EDT
> virt-xml-validate should give error info for "\/" as the name of a guest in xml

This is really a semantic XML check, that is applied post-parsing. The virt-xml-validate tool only applies syntactic XML checks / schema validation for parse-time.

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