Bug 1366119

Summary: Screenshot does not work with qxl video model type.
Product: Red Hat Enterprise Linux 7 Reporter: Yanqiu Zhang <yanqzhan>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: dyuan, fjin, mzhan, rbalakri, yafu, yanqzhan, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 18:52:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
log_qxl_failed
none
log_cirrus_success none

Description Yanqiu Zhang 2016-08-11 06:05:17 UTC
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 Yanqiu Zhang 2016-08-11 06:08:39 UTC
Created attachment 1189915 [details]
log_cirrus_success

Comment 3 Yanqiu Zhang 2016-08-11 08:01:25 UTC
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 10:57:24 UTC
Upstream commit:

commit ef11e770da543c171f044bbd579e482febcd9b63
Author: Pavel Hrdina <phrdina>
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 06:47:22 UTC
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 18:52:21 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