Bug 828676 - virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elements
virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elem...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-06-05 03:47 EDT by min zhan
Modified: 2013-02-21 02:16 EST (History)
8 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:16:25 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description min zhan 2012-06-05 03:47:14 EDT
Description of problem:
virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elements

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Prepare a guest xml contains kernel/initrd/cmdline elements to customize the own kernel parameters, for example.

# cat rhel63_before.xml 
<domain type='kvm' id='3'>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel63.img'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    <interface type='network'>
      <mac address='52:54:00:4d:f3:f2'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes'/>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
  <seclabel type='dynamic' model='selinux' relabel='yes'>

2. # virsh define rhel63_before.xml 
Domain rhel63_new defined from rhel63_before.xml

3. # virt-xml-validate rhel63_before.xml 
rhel63_before.xml:7: element type: Relax-NG validity error : Error validating value 
rhel63_before.xml:8: element kernel: Relax-NG validity error : Expecting element boot, got kernel
Relax-NG validity error : Extra element kernel in interleave
rhel63_before.xml:8: element kernel: Relax-NG validity error : Element os failed to validate content
rhel63_before.xml:7: element type: Relax-NG validity error : Element type failed to validate content
rhel63_before.xml:1: element domain: Relax-NG validity error : Element domain failed to validate content
rhel63_before.xml fails to validate

Actual results:
As above

Expected results:
virt-xml-validate works well

Additional info:
When remove these 3 elements from xml, virt-xml-validate works well
Comment 1 Osier Yang 2012-06-15 09:59:50 EDT
Commit b34324fbf in upstream, move to POST.
Comment 3 yanbing du 2012-07-24 04:59:30 EDT
With libvirt-0.9.13-3.el6.x86_64, the bug can be verified.
Use the same XML file in bug description, and check it:
# virt-xml-validate rhel63.xml 
bug.xml validates
Comment 4 errata-xmlrpc 2013-02-21 02:16:25 EST
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.


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