Bug 813191
Summary: | virt-xml-validate fail for pool, nodedev and capabilities | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | dyuan |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 6.3 | CC: | acathrow, ajia, bili, dallan, dyasny, eblake, mzhan, rwu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.10.0-0rc1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 07:11:44 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: | |||
Bug Depends On: | 616721 | ||
Bug Blocks: |
Description
dyuan
2012-04-17 07:45:23 UTC
Upstream has also discussed the idea of adding an API to canonicalize and optionally validate XML; if that API is added, this bug becomes more important to fix (since we are then making it much easier to trigger validation). See bug 616721 for the normalization API proposal Upstream patch proposed: https://www.redhat.com/archives/libvir-list/2012-August/msg00028.html Fixed by commit 37a10129c24d7dcb05522d50a1f3039d338646ad Update xml schemas according to libvirt source Verified with : # vi network.xml Using the same as Description # virt-xml-validate network.xml network network.xml validates # vi pool.xml Using the same as Description # virt-xml-validate pool.xml storagepool pool.xml validates # vi vol.xml Using the same as Description # virt-xml-validate vol.xml storagevol vol.xml validates # vi nodedev.xml Using the same as Description # virt-xml-validate nodedev.xml nodedev nodedev.xml validates # vi capa.xml Using the same as Description # virt-xml-validate capa.xml capa.xml validates All validate successfully. Moving to VERIFIED. Hi jtomko, I found that virt-xml-validate should fail when there is no <path> element in the xml, but it pass: 1.# cat pool.xml <pool type='dir'> <name>test</name> <capacity unit='bytes'>82569920512</capacity> <allocation unit='bytes'>22617657344</allocation> <available unit='bytes'>59952263168</available> <source> </source> <target> <permissions> <mode>0700</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> 2. # virt-xml-validate pool.xml pool.xml validates # echo $? 0 3. # virt-xml-validate pool.xml storagepool pool.xml validates # echo $? 0 Validate pass, however can not be defined successfully: 4. # virsh pool-define pool.xml error: Failed to define pool from pool.xml error: XML error: missing storage pool target path # echo $? 1 Should I file another bug for it? Thanks, EricLee And there is another problem of volume.xml: do not add <source> element to vol.xml # cat vol.xml <volume> <name>rhel6.img</name> <capacity unit='bytes'>8589934592</capacity> <allocation unit='bytes'>1043378176</allocation> <target> <permissions> <mode>0600</mode> <owner>0</owner> <group>0</group> <label>system_u:object_r:virt_image_t:s0</label> </permissions> </target> </volume> # virt-xml-validate vol.xml vol.xml:3: element capacity: Relax-NG validity error : Did not expect element capacity there vol.xml fails to validate But can create a volume from that xml: # virsh vol-create default vol.xml Vol rhel6.img created from vol.xml # virsh vol-list default Name Path ----------------------------------------- rhel6.img /var/lib/libvirt/images/rhel6.img # virsh vol-dumpxml rhel6.img default <volume> <name>rhel6.img</name> <key>/var/lib/libvirt/images/rhel6.img</key> <source> </source> <capacity unit='bytes'>8589934592</capacity> <allocation unit='bytes'>1044402176</allocation> <target> <path>/var/lib/libvirt/images/rhel6.img</path> <format type='raw'/> <permissions> <mode>0600</mode> <owner>0</owner> <group>0</group> <label>unconfined_u:object_r:virt_image_t:s0</label> </permissions> <timestamps> <atime>1357610541</atime> <mtime>1357610526</mtime> <ctime>1357610526</ctime> </timestamps> </target> </volume> So virt-xml-validate should pass in this case. And I also think this bug should not be fixed totally yet. Yes, file another bug for this please. (In reply to comment #10) > Yes, file another bug for this please. Hi jtomko, Thanks for your reply. I have filed another bug for comment #8 : Bug 893273 - virt-xml-validate pass but pool can not be defined by the xml However, how about comment #9 's problem ? Thanks, EricLee I think that one can be added to bug 893273 as well. (In reply to comment #12) > I think that one can be added to bug 893273 as well. Okay, thanks for reply: https://bugzilla.redhat.com/show_bug.cgi?id=893273#c1. 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. http://rhn.redhat.com/errata/RHSA-2013-0276.html |