Bug 512069 - virsh dumpxml produces invalid XML according to virt-xml-validate
virsh dumpxml produces invalid XML according to virt-xml-validate
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
5.4
All Linux
low Severity low
: beta
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-16 03:19 EDT by Roel Gloudemans
Modified: 2014-11-10 07:05 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 04:11:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Roel Gloudemans 2009-07-16 03:19:36 EDT
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 Berrange 2009-07-16 08:30:13 EDT
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 05:35:08 EST
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 05:36:46 EST
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 11:08:47 EST
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 00:54:08 EST
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 00:57:01 EST
Created attachment 380746 [details]
rhel5u5_x86_64_kvm xml file
Comment 9 Alex Jia 2009-12-29 00:57:53 EST
Created attachment 380747 [details]
rhel5u5_x86_64_xenpv xml file
Comment 10 Alex Jia 2009-12-29 00:58:31 EST
Created attachment 380748 [details]
rhel5u5_x86_64_xenfv xml file
Comment 12 zhanghaiyan 2010-01-11 03:54:52 EST
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 04:10:41 EST
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 04:11:19 EDT
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.