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 828676 - virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elements
Summary: virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elem...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-05 07:47 UTC by Min Zhan
Modified: 2013-02-21 07:16 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:16:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Min Zhan 2012-06-05 07:47:14 UTC
Description of problem:
virt-xml-validate validate fails when xml contains kernel/initrd/cmdline elements

Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6

How reproducible:
Always

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'>
  <name>rhel63_new</name>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <kernel>/var/lib/libvirt/boot/virtinst-vmlinuz.AI6hG7</kernel>
    <initrd>/var/lib/libvirt/boot/virtinst-initrd.img.m_fNbg</initrd>
    <cmdline>method=http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL6.3-20120531.0/6.3/Server/x86_64/os/</cmdline>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <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'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <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'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <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'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c434,c616</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c434,c616</imagelabel>
  </seclabel>
</domain>

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 13:59:50 UTC
Commit b34324fbf in upstream, move to POST.

Comment 3 yanbing du 2012-07-24 08:59:30 UTC
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 07:16:25 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/RHSA-2013-0276.html


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