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 893273 - virt-xml-validate pass but pool can not be defined by the xml
Summary: virt-xml-validate pass but pool can not be defined by the xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-09 02:04 UTC by EricLee
Modified: 2014-10-14 04:14 UTC (History)
5 users (show)

Fixed In Version: libvirt-0.10.2-31.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 04:14:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Description EricLee 2013-01-09 02:04:37 UTC
Description of problem:
virt-xml-validate pass but pool can not be defined by the xml

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

How reproducible:
100%

Steps to Reproduce:
1. Do not add <path> element in <target> of a pool xml file:
# 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

4. # virsh pool-define pool.xml
error: Failed to define pool from pool.xml
error: XML error: missing storage pool target path

# echo $?
1

Actual results:
as steps

Expected results:
virt-xml-validate should be failed.

Additional info:

Comment 1 EricLee 2013-01-10 02:11:46 UTC
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.

Comment 2 Ján Tomko 2013-05-17 06:56:41 UTC
Fixed upstream by:
commit 25b98d31ec5519a914551a6cab15c8d8b4e67034
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-05-16 15:43:06 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-05-17 08:35:08 +0200

    schema: make source optional in volume XML
    
    We don't parse it anyway.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=893273

commit a07b88ee03f350f0b4d62c3cc1481c16f7e369e3
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-05-16 15:37:14 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-05-17 08:33:22 +0200

    schema: require target path in storage pool xml
    
    Make target path mandatory for pool types that require target,
    since we refuse to parse a target without a path.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=893273

git describe: v1.0.5-249-g25b98d3

Comment 3 Jiri Denemark 2013-06-11 09:56:04 UTC
We decided not to rebase libvirt in RHEL 6.5 to avoid stability issues
we faced in 6.4. This bug has already been fixed upstream but it is
considered unsuitable for backporting to RHEL 6.5 because at least one
of the following conditions is met:

- this bug requires new API(s), which we cannot introduce without
  rebasing libvirt
- the patches required to address this bug are complex or invasive
  causing the backport to be too risky
- this bug is not important enough to justify backporting non-trivial
  patches for it

Thus I'm pushing this bug to RHEL 6.6 (and setting Upstream keyword to
indicate we have patches upstream) for now. If you don't agree with
this resolution, please, give us reasons which you think are strong
enough for us to reevaluate the decision not to backport patches for
this bug.

Comment 8 EricLee 2014-04-14 09:13:03 UTC
Verified pass in libvirt-0.10.2-32.el6:

pool.xml and vol.xml just as like description and comment #1:

# virt-xml-validate pool.xml
pool.xml:6: element source: Relax-NG validity error : Expecting element target, got source
pool.xml:8: element target: Relax-NG validity error : Expecting element path, got permissions
pool.xml:8: element target: Relax-NG validity error : Element target failed to validate content
pool.xml:5: element available: Relax-NG validity error : Expecting element target, got available
pool.xml:1: element pool: Relax-NG validity error : Element pool failed to validate content
pool.xml fails to validate

# virt-xml-validate pool.xml storagepool
pool.xml:6: element source: Relax-NG validity error : Expecting element target, got source
pool.xml:8: element target: Relax-NG validity error : Expecting element path, got permissions
pool.xml:8: element target: Relax-NG validity error : Element target failed to validate content
pool.xml:5: element available: Relax-NG validity error : Expecting element target, got available
pool.xml:1: element pool: Relax-NG validity error : Element pool failed to validate content
pool.xml fails to validate

# echo $?
3

# virt-xml-validate vol.xml 
vol.xml validates

Works fine, setting verified.

Comment 11 errata-xmlrpc 2014-10-14 04:14:55 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.

http://rhn.redhat.com/errata/RHBA-2014-1374.html


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