Bug 512069 - virsh dumpxml produces invalid XML according to virt-xml-validate
Summary: virsh dumpxml produces invalid XML according to virt-xml-validate
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.4
Hardware: All
OS: Linux
low
low
Target Milestone: beta
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-16 07:19 UTC by Roel Gloudemans
Modified: 2014-11-10 12:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:11:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch fixing the issue by adding the extra optional attribute (391 bytes, patch)
2009-11-18 10:35 UTC, Daniel Veillard
no flags Details | Diff
rhel5u5_x86_64_kvm xml file (1.13 KB, application/xml)
2009-12-29 05:57 UTC, Alex Jia
no flags Details
rhel5u5_x86_64_xenpv xml file (1.17 KB, application/xml)
2009-12-29 05:57 UTC, Alex Jia
no flags Details
rhel5u5_x86_64_xenfv xml file (1.33 KB, application/xml)
2009-12-29 05:58 UTC, Alex Jia
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0205 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2010-03-29 12:27:37 UTC

Description Roel Gloudemans 2009-07-16 07:19:36 UTC
Description of problem:
When the XML config of a running VM is dumped to file and validated with virt-xml-validate, the validate fails with:

test.xml:43: element console: Relax-NG validity error : Invalid attribute tty for element console
Relax-NG validity error : Extra element devices in interleave
test.xml:1: element domain: Relax-NG validity error : Element domain failed to validate content
test.xml fails to validate


Version-Release number of selected component (if applicable):
libvirt-0.6.3-11.el5

How reproducible:
Dump xml and validate


Steps to Reproduce:
1.virsh dumpxml 5 > test.xml
2.virt-xml-validate test.xml
3.
  
Actual results:
Fails validation

Expected results:
Succeeds validation

Additional info:
The problem is here. The dumpxml output:
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </console>
 
Should be:
    <console type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </console>

Comment 1 Daniel Berrangé 2009-07-16 12:30:13 UTC
That extra tty attribute is present for backwards compatibility with previous libvirt releases. Looks like we forgot that in the RNG schema though. need to fix the schema

Comment 3 Daniel Veillard 2009-11-18 10:35:08 UTC
Created attachment 370052 [details]
Patch fixing the issue by adding the extra optional attribute

This patches fixes the issue, it also somehow validates the
content of the attribute,

Daniel

Comment 4 Daniel Veillard 2009-11-18 10:36:46 UTC
A similar fix but different due to changes in the schemas since
0.6.3 has been posted upstream:

https://www.redhat.com/archives/libvir-list/2009-November/msg00620.html

Daniel

Comment 5 Daniel Veillard 2009-11-25 16:08:47 UTC
libvirt-0.6.3-22.el5 has been built in dist-5E-qu-candidate with
the fixes,

Daniel

Comment 7 Alex Jia 2009-12-29 05:54:08 UTC
This bug has been verified with libvirt 0.6.3-22.el5 on RHEL-5.5,including xen and kvm host:

1.xen hypervisor
[root@dhcp-66-70-62 ~]# virsh start rhel5u5_x86_64_xenpv
Domain rhel5u5_x86_64_xenpv started

[root@dhcp-66-70-62 ~]# virsh dumpxml rhel5u5_x86_64_xenpv> rhel5u5_x86_64_xenpv.xml

[root@dhcp-66-70-62 ~]# virt-xml-validate rhel5u5_x86_64_xenpv.xml 
rhel5u5_x86_64_xenpv.xml validates

[root@dhcp-66-70-62 ~]# virsh start rhel5u5_x86_64_xenfv
Domain rhel5u5_x86_64_xenfv started

[root@dhcp-66-70-62 ~]# virsh dumpxml rhel5u5_x86_64_xenfv> rhel5u5_x86_64_xenfv.xml

[root@dhcp-66-70-62 ~]# virt-xml-validate rhel5u5_x86_64_xenfv.xml
rhel5u5_x86_64_xenfv.xml validates

2.kvm hypervisor
[root@dhcp-66-70-62 ~]# virsh start rhel5u5
Domain rhel5u5 started

[root@dhcp-66-70-62 ~]# virsh dumpxml rhel5u5 > rhel5u5_x86_64_kvm.xml

[root@dhcp-66-70-62 ~]# virt-xml-validate rhel5u5_x86_64_kvm.xml
rhel5u5_x86_64_kvm.xml validates

Component information:
1.xen host
[root@dhcp-66-70-62 tmp]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5xen #1 SMP Mon Dec 21 18:46:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 tmp]# rpm -qa|grep virt
virt-viewer-0.0.2-3.el5
libvirt-python-0.6.3-22.el5
rhn-virtualization-common-5.3.0-4.el5sat
libvirt-debuginfo-0.6.3-22.el5
python-virtinst-0.400.3-5.el5
libvirt-0.6.3-22.el5
virt-manager-0.6.1-11.el5
[root@dhcp-66-70-62 tmp]# rpm -qa|grep xen
xen-libs-3.0.3-102.el5
xen-devel-3.0.3-102.el5
kmod-gnbd-xen-0.1.5-2.el5
kmod-gfs-xen-0.1.34-9.el5
xen-3.0.3-102.el5
xen-libs-3.0.3-102.el5
kernel-xen-2.6.18-183.el5
kmod-cmirror-xen-0.1.22-3.el5

2.kvm host[root@dhcp-66-70-62 bug]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5 #1 SMP Mon Dec 21 18:37:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 bug]# lsmod|grep kvm
kvm_intel              86664  0
kvm                   223648  2 ksm,kvm_intel
[root@dhcp-66-70-62 bug]# rpm -qa|grep libvirt
libvirt-python-0.6.3-22.el5
libvirt-debuginfo-0.6.3-22.el5
libvirt-0.6.3-22.el5
[root@dhcp-66-70-62 bug]# rpm -qa|grep kvm
kvm-tools-83-140.el5
kvm-qemu-img-83-140.el5
etherboot-zroms-kvm-5.4.4-13.el5
kvm-83-140.el5
etherboot-roms-kvm-5.4.4-13.el5
kmod-kvm-83-140.el5


Guest xml description:
see attachment.

Comment 8 Alex Jia 2009-12-29 05:57:01 UTC
Created attachment 380746 [details]
rhel5u5_x86_64_kvm xml file

Comment 9 Alex Jia 2009-12-29 05:57:53 UTC
Created attachment 380747 [details]
rhel5u5_x86_64_xenpv xml file

Comment 10 Alex Jia 2009-12-29 05:58:31 UTC
Created attachment 380748 [details]
rhel5u5_x86_64_xenfv xml file

Comment 12 zhanghaiyan 2010-01-11 08:54:52 UTC
Verified this bug PASS with libvirt-0.6.3-29.el5 on RHEL-5.5-Serer-x86_64-xen.
(Tested with the attached 3 .xml file)

Comment 13 Johnny Liu 2010-02-02 09:10:41 UTC
Verified this bug PASS with libvirt-0.6.3-31.el5 on RHEL-5.5-Serer-x86_64-kvm.
(Tested with the attached 3 .xml file)

Comment 15 errata-xmlrpc 2010-03-30 08:11:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html


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