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>
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
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
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
libvirt-0.6.3-22.el5 has been built in dist-5E-qu-candidate with the fixes, Daniel
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.
Created attachment 380746 [details] rhel5u5_x86_64_kvm xml file
Created attachment 380747 [details] rhel5u5_x86_64_xenpv xml file
Created attachment 380748 [details] rhel5u5_x86_64_xenfv xml file
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)
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)
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