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 1668141 - libvirt can set default video model=cirrus even if qemu doesn't support it
Summary: libvirt can set default video model=cirrus even if qemu doesn't support it
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.0
Assignee: Pavel Mores
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On: 1668139
Blocks: 1746622
TreeView+ depends on / blocked
 
Reported: 2019-01-22 03:37 UTC by zonglin jiang
Modified: 2023-05-01 09:36 UTC (History)
13 users (show)

Fixed In Version: libvirt-6.0.0-17.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1668139
Environment:
Last Closed: 2020-08-15 05:31:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-30138 0 None None None 2023-05-01 09:36:52 UTC

Description zonglin jiang 2019-01-22 03:37:05 UTC
+++ This bug was initially created as a clone of Bug #1668139 +++

Description of problem:
Incorrect default video device type after adding graphical device on rhel8

Version-Release number of selected component (if applicable):
virt-manager-2.0.0-2.el8.noarch
qemu-kvm-2.12.0-57.module+el8+2683+02b3b955.x86_64
libvirt-4.5.0-18.module+el8+2691+dc742e5d.x86_64
python3-libvirt-4.5.0-1.module+el8+2529+a9686a4d.x86_64
kernel-4.18.0-60.el8.x86_64


How reproducible
100%

Steps to Reproduce
1.Launch virt-manager, Open an existing VM and remove all its graphical and video devices
2.Click "Add Hardware">"Graphics" to add a display device


Actual results:
After step 2,another video device is added and its model type is "cirrus" while it is not in the drop list that can be chosen

Expected results:
Default video type should not be "circus"

Comment 1 Cole Robinson 2019-03-30 19:33:01 UTC
From https://bugzilla.redhat.com/show_bug.cgi?id=1668139#5

> Looks like a libvit bug. qemuDomainDeviceVideoDefPostParse will set a video
> model without checking if qemu supports it, despite the fact that
> qemuProcessStartValidateVideo later will check qemu capabilities and reject
> the cirrus config.
> 
> Kind of a corner case though so not a priority for fixing in 8.0 GA

Comment 2 Pavel Mores 2019-11-26 09:25:15 UTC
Fixed by

d3f2a8bd47 qemu: added tests of the new default video type selection algorithm
33a9757852 qemu: the actual change of default video devide type selection algorithm
4a067e70fa qemu: prepare existing test for change of the default video device type
b648d96289 qemu: default video device type selection algoritm moved into its own function

v5.9.0-395-gb648d96289

Comment 5 yafu 2020-06-08 09:46:19 UTC
Hi Pavel,

I test with libvirt-6.0.0-17.module+el8.3.0+6423+e4cb6418.x86_64 and qemu-kvm-4.2.0-23.module+el8.3.0+6922+fd575af8.x86_64, libvirt still set 'cirrus' video as the default video. Could you help to check that please?

# virsh domcapabilities | grep -A8 video
    <video supported='yes'>
      <enum name='modelType'>
        <value>vga</value>
        <value>cirrus</value>
        <value>qxl</value>
        <value>virtio</value>
        <value>none</value>
        <value>bochs</value>
      </enum>
    </video>


# /usr/libexec/qemu-kvm -device cirrus-vga
qemu-kvm: -device cirrus-vga: warning: 'cirrus-vga' is deprecated, please use a different VGA card instead

Remove video device in guest xml, then check the default video devcie added by libvirt:
#virsh dumpxml vm1 | grep -A5 video
# virsh dumpxml vm1 | grep -A4 video
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

Comment 6 Pavel Mores 2020-06-08 16:00:42 UTC
Hi,

if cirrus is supported by an emulator binary - as seems to be the case here (judging from the 'virsh domcapabilities' output that you posted) - then cirrus is still preferred to plain vga (please see also https://bugzilla.redhat.com/show_bug.cgi?id=1668139#c8 and the discussion that follows) so its addition as a default video device is expected and OK.

Now, admittedly I'm not sure how to interpret the output of the 'qemu-kvm -device cirrus-vga' command.  Is /usr/libexec/qemu-kvm the same binary as the one that 'virsh domcapabilities' outputs capabilities for?

In any case my fix relies on QEMU capabilities to decide whether cirrus is supported.  So as long as the capabilities indicate that cirrus is indeed supported, it will be used.

Hope this helps, please don't hesitate to let me know if it doesn't.

Comment 7 yafu 2020-06-09 04:41:09 UTC
(In reply to Pavel Mores from comment #6)
> Hi,
> 
> if cirrus is supported by an emulator binary - as seems to be the case here
> (judging from the 'virsh domcapabilities' output that you posted) - then
> cirrus is still preferred to plain vga (please see also
> https://bugzilla.redhat.com/show_bug.cgi?id=1668139#c8 and the discussion
> that follows) so its addition as a default video device is expected and OK.
> 
> Now, admittedly I'm not sure how to interpret the output of the 'qemu-kvm
> -device cirrus-vga' command.  Is /usr/libexec/qemu-kvm the same binary as
> the one that 'virsh domcapabilities' outputs capabilities for?
> 
> In any case my fix relies on QEMU capabilities to decide whether cirrus is
> supported.  So as long as the capabilities indicate that cirrus is indeed
> supported, it will be used.
> 
> Hope this helps, please don't hesitate to let me know if it doesn't.

But it's not reasonable that libvirt still uses cirrus as default video even when cirrus is supported but deprecated by qemu-kvm。

Comment 8 Cole Robinson 2020-06-10 15:49:43 UTC
(In reply to yafu from comment #7)
> But it's not reasonable that libvirt still uses cirrus as default video even
> when cirrus is supported but deprecated by qemu-kvm。

The intention of the original bug was that libvirt would be changed to not hardcode
cirrus usage when we know the qemu binary has cirrus compiled out. I thought that
was the case for RHEL8. Turns out cirrus is compiled in, but prints a warning
message to the logs that it is deprecated.

IMO libvirt is behaving correctly here with respect to libvirt policies. qemu
technically provides cirrus support even if in RHEL we don't 'support' it. libvirt
in this case will continue to use cirrus when no explicit video model is specified,
to maintain config back compat with the way it has always behaved.

Changing libvirt to use something else even when cirrus is available is a possibility
but it would be a downstream only change and IMO not worth bothering with. The
case of a user entering a bare <video> device with no specified model is really
a corner case that we shouldn't stress over, all apps that specify <video> are going
to fill in a better value here since it requires knowledge of what guest OS is
being installed.

Because cirrus isn't compiled out in RHEL8 this bug report is more tracking a
theoretical issue than a practical one affecting the distro. On those grounds we
could just close this and drop it from the errata. Or mark it VERIFIED on those
grounds and continue on. But I don't think there's any more work that needs to
be done in this area (unless I'm missing something)

Comment 9 Lili Zhu 2020-08-15 05:31:51 UTC
Based on the grounds mentioned in Comment 8, mark the bug as closed. 
Please help to drop it from the errata. Thanks

Comment 11 Lili Zhu 2020-09-16 16:11:14 UTC
Has been dropped from errata

Comment 12 Lili Zhu 2020-09-16 16:11:29 UTC
Has been dropped from errata


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