Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1325757 - virsh create fails if <video> element is not set in XML
virsh create fails if <video> element is not set in XML
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-11 02:30 EDT by lcheng
Modified: 2016-11-03 14:41 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.3.4-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:41:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description lcheng 2016-04-11 02:30:30 EDT
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 09:40:56 EDT
Upstream patches:
https://www.redhat.com/archives/libvir-list/2016-April/msg00495.html
Comment 3 Ján Tomko 2016-04-12 04:58:51 EDT
Fixed upstream by:
commit 6d8b6d2847f31a3d7a234536c12b8feca751a02f
Author:     Ján Tomko <jtomko@redhat.com>
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 05:53:49 EDT
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 14:41:46 EDT
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.