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 1325757 - virsh create fails if <video> element is not set in XML
Summary: virsh create fails if <video> element is not set in XML
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-11 06:30 UTC by lcheng
Modified: 2016-11-03 18:41 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.3.4-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:41:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description lcheng 2016-04-11 06:30:30 UTC
Description of problem:
When video element don't set in xml file, guest create failed.

Version-Release number of selected component (if applicable):
libvirt-1.3.3-1.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64


How reproducible:
100%

Steps to Reproduce:

[root@hp-dl380pgen8-01 ~]# cat test.xml
<domain type="kvm">
  <name>nfs</name>
  <memory>1048576</memory>
  <vcpu>1</vcpu>
  <os>
    <type machine="pc">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset="utc"/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <disk device="disk" type="file">
      <driver name="qemu" type='qcow2'/>
      <source file='/var/lib/libvirt/images/libvirt-test-api'/>
      <target bus='virtio' dev='vda'/>
    </disk>
    <interface type="network">
      <source network="default"/>
      <mac address='54:52:00:45:a1:2c'/>
      <model type='virtio'/>
    </interface>
    <console/>
    <input bus="ps2" type="mouse"/>
    <graphics keymap="en-us" port="-1" autoport="yes" type="vnc"/>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/snapshotguest-nfs.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>
  </devices>
</domain>

[root@hp-dl380pgen8-01 ~]# virsh create test.xml
error: Failed to create domain from test.xml
error: unsupported configuration: non-primary video device must be type of 'qxl'


Actual results:
Guest create failed.

Expected results:
Guest create successful.


Additional info:
It works well with libvirt-1.3.2-1.el7.x86_64.

Comment 2 Ján Tomko 2016-04-11 13:40:56 UTC
Upstream patches:
https://www.redhat.com/archives/libvir-list/2016-April/msg00495.html

Comment 3 Ján Tomko 2016-04-12 08:58:51 UTC
Fixed upstream by:
commit 6d8b6d2847f31a3d7a234536c12b8feca751a02f
Author:     Ján Tomko <jtomko>
CommitDate: 2016-04-12 10:45:35 +0200

    conf: also mark the implicit video as primary
    
    Commit 119cd06 started setting the primary bool for the first
    user-specified video even if user omitted the 'primary' attribute.
    
    However this was done before the addition of the implicit device.
    This broke startup of transient qemu domains with no <video>:
    https://bugzilla.redhat.com/show_bug.cgi?id=1325757
    
    Move this default to virDomainDefPostParseInternal,
    after the addition of the implicit video device, to catch the implicit
    video as well.

git describe: v1.3.3-64-g6d8b6d2

Comment 5 Fangge Jin 2016-06-29 09:53:49 UTC
I can reproduce this BZ on build libvirt-1.3.3-2.el7.x86_64.

Verify pass on build libvirt-1.3.5-1.el7.x86_64

Steps:
1. Prepare a guest xml without video element.
# grep video rhel7.2.xml
(nothing output)

2. # virsh create rhel7.2.xml
Domain rhel7.2 created from rhel7.2.xml

3. Dump guest xml, video device is added automatically and marked as primary:
# virsh dumpxml rhel7.2
...
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
...

4. Re-test step 1~3 with the following guest xml:
    <video>
      <model type='cirrus' vram='16384' heads='1'/>  ==> with video element and without specified primary
    </video>

5. Re-test step 1~3 with the following guest xml:
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/> ==> with video element and with specified primary
    </video>

6. Prepare a guest xml without video element.
# grep video rhel7.2.xml
(nothing output)

7. Define guest:
# virsh undefine rhel7.2
Domain rhel7.2 has been undefined

8. Check guest xml, video device is added automatically and marked as primary:
# virsh dumlxml rhel7.2
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>


9. Undefine guest rhel7.2 and Re-test step 6~8 with the following guest xml:
...
    <video>
      <model type='cirrus' vram='16384' heads='1'/>  ==> with video element and without specified primary
    </video>
...

10. Undefine guest rhel7.2 and Re-test step 6~8 with the following guest xml:
...
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
    </video>
...

11. Guest rhel7.2 has been defined, delete video element by "virsh edit" and save:
# virsh edit rhel7.2
Domain rhel7.2 XML configuration edited.

12. Check guest xml, video device is added automatically and marked as primary:
# virsh dumlxml rhel7.2
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>

Comment 7 errata-xmlrpc 2016-11-03 18:41:46 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.

https://rhn.redhat.com/errata/RHSA-2016-2577.html


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