Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1366119 - Screenshot does not work with qxl video model type.
Screenshot does not work with qxl video model type.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-11 02:05 EDT by yanqzhan@redhat.com
Modified: 2016-11-03 14:52 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-2.0.0-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:52:21 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)
log_qxl_failed (300.88 KB, text/plain)
2016-08-11 02:05 EDT, yanqzhan@redhat.com
no flags Details
log_cirrus_success (771.02 KB, text/plain)
2016-08-11 02:08 EDT, yanqzhan@redhat.com
no flags Details


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 yanqzhan@redhat.com 2016-08-11 02:05:17 EDT
Created attachment 1189914 [details]
log_qxl_failed

Description of problem:
Screenshot does not work with qxl video model type.

Version-Release number of selected component (if applicable):
libvirt-2.0.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a domain with following xml:
......
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
    </graphics>
......
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
......

2.# virsh start usrvm 

3.Do screenshot operation:
# virsh screenshot usrvm
error: could not take a screenshot of usrvm
error: invalid argument: no such screen

4.Edit domain xml with 'vnc' graphics, retest step 2~3
      <graphics type='vnc' port='-1' autoport='yes'>
      <listen type='address'/>
    </graphics>

5.Check error in log file:
# cat /var/log/libvirt/libvirtd.log|grep error
2016-08-11 05:39:31.060+0000: 27707: error : qemuDomainScreenshot:3807 : invalid argument: no such screen
For detailed logs, pls refer to attachment.

Actual results:
As step 3 descripted. And step 4 got the same error.
Both spice and vnc graphics can trigger this problem.

Expected results:
Screenshot should be done successfully.

Additional info:
1.It works well with "virtio"/"vga"/"cirrus" video model type:
             ...
      <model type='vga' vram='16384' heads='1' primary='yes'/>
             ...
# virsh screenshot usrvm
Screenshot saved to usrvm-2016-08-11-12:50:08.ppm, with type of image/x-portable-pixmap
             ...
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
             ...
# virsh screenshot usrvm
Screenshot saved to usrvm-2016-08-11-12:52:47.ppm, with type of image/x-portable-pixmap
             ...
      <model type='virtio' vram='16384' heads='1' primary='yes'/>
             ...
# virsh screenshot usrvm
Screenshot saved to usrvm-2016-08-11-12:53:58.ppm, with type of image/x-portable-pixmap

# ls|grep ppm
usrvm-2016-08-11-12:50:08.ppm
usrvm-2016-08-11-12:52:47.ppm
usrvm-2016-08-11-12:53:58.ppm


2.It works well on rhel7.2 with libvirt-1.2.17-13.el7.x86_64.
Steps:
Scp the xml with qxl video to rhel7.2 host, define and start the guest, do screenshot:
# virsh screenshot usrvm
Screenshot saved to usrvm-2016-08-10-18:57:48.ppm, with type of image/x-portable-pixmap
# ls | grep ppm
usrvm-2016-08-10-18:57:48.ppm
 
3.This problem also happens with libvirt-2.0.0-2.el7.x86_64 or libvirt-2.0.0-4.el7.x86_64.
Comment 1 yanqzhan@redhat.com 2016-08-11 02:08 EDT
Created attachment 1189915 [details]
log_cirrus_success
Comment 3 yanqzhan@redhat.com 2016-08-11 04:01:25 EDT
I found that maybe the "heads" attribute affects.

1.After start the guest, its video xml changes to be:
 <model type='qxl' ram='65536' vram='65536' vgamem='16384' primary='yes'/>

"heads=1" is automatically deleted.


2.But it wasn't deleted when use "virtio"/"vga"/"cirrus" video model type.

3.And it also reserved on rhel7.2 with libvirt-1.2.17-13.el7.x86_64:
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>

4.If restart libvirtd, the "heads" attribute returns:
# diff before_libvirtd after_libvirtd
148c148
<       <model type='qxl' ram='65536' vram='65536' vgamem='16384' primary='yes'/>
---
>       <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
And sceenshot operation can be done successfully.
Comment 4 Pavel Hrdina 2016-08-15 06:57:24 EDT
Upstream commit:

commit ef11e770da543c171f044bbd579e482febcd9b63
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Fri Aug 12 16:12:39 2016 +0200

    qemu_command: don't modify heads for graphics device
Comment 7 Fangge Jin 2016-08-26 02:47:22 EDT
Reproduced on build libvirt-2.0.0-5.el7.x86_64

Verify pass on build libvirt-2.0.0-6.el7.x86_64
Steps:
1. Prepare a domain with video head=2:
    <video>
      <model type='qxl' ram='1048576' vram='16384' vgamem='16384' **heads='2'** primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>


2. Start guest and take screenshots :
# virsh screenshot rhel7
Screenshot saved to rhel7-2016-08-26-14:46:55.ppm, with type of image/x-portable-pixmap

# virsh screenshot rhel7 --screen 0
Screenshot saved to rhel7-2016-08-26-14:38:04.ppm, with type of image/x-portable-pixmap

# virsh screenshot rhel7 --screen 1
Screenshot saved to rhel7-2016-08-26-14:38:05.ppm, with type of image/x-portable-pixmap

# virsh screenshot rhel7 --screen 2
error: could not take a screenshot of rhel7
error: invalid argument: no such screen

3. Check dumpxml, heads='2' is output in dumpxml:
# virsh dumpxml rhel7
    <video>
      <model type='qxl' ram='524288' vram='16384' vgamem='16384' **heads='2'** primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>

4. Restart libvirtd and check dumpxml again:
# virsh dumpxml rhel7
    <video>
      <model type='qxl' ram='524288' vram='16384' vgamem='16384' **heads='2'** primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
Comment 9 errata-xmlrpc 2016-11-03 14:52:21 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.