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 705070 - QMP: screendump command does not allow specification of monitor to capture
Summary: QMP: screendump command does not allow specification of monitor to capture
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 701287 (view as bug list)
Depends On:
Blocks: 559201 691830 710489
TreeView+ depends on / blocked
 
Reported: 2011-05-16 14:52 UTC by Daniel Berrangé
Modified: 2011-12-06 15:41 UTC (History)
10 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.180.el6
Doc Type: Bug Fix
Doc Text:
Cause It is (was) impossible to make sccreenshots from secondary qxl displays. Change A monitor command was added to fill the gap.
Clone Of:
Environment:
Last Closed: 2011-12-06 15:41:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1531 0 normal SHIPPED_LIVE Moderate: qemu-kvm security, bug fix, and enhancement update 2011-12-06 01:23:30 UTC

Description Daniel Berrangé 2011-05-16 14:52:21 UTC
Description of problem:

The screendump command allows capturing the current state of the primary monitor. With the introduction of SPICE with QXL display adapter, it is possible to have multiple monitors. The 'screendump' command needs an extra parameter to specify which device to capture.


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.161.el6

How reproducible:
Always

Steps to Reproduce:
1. Run a guest with

 -vga qxl -global qxl-vga.vram_size=33554432 -device qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x4

2. Try to capture a screendump of the 'video1' card, instead of the default card
3.
  
Actual results:


Expected results:


Additional info:

Comment 4 Gerd Hoffmann 2011-05-31 14:35:02 UTC
This isn't just the monitor command.  Currently qemu doesn't handle multiple displays at all, thats why a number of things work for the first qxl device only (vga compatibility, screendumpable, viewable via vnc, ...).

Fixing this involves a bunch of non-trivial and likely intrusive upstream work, I doubt we'll ever see this in RHEL-6.

We can make this a RHEL-7 RFE ...
Alternatively RHEL-6.x with upstream cond-nack, but it's not realistic IMHO.

An alternative approach to do screen shots would be to connect using the spice protocol and write out a screen dump.  A little proof-of-concept tool exists (called snappy, comes with spice-gtk).  Drawback is that the spice server (currrently) supports only one client at a time, so this would disturb any users currently connected to the VM via spice as they would be disconnected.

Comment 5 Daniel Berrangé 2011-05-31 15:50:47 UTC
Hmm, I can see why getting the right, upstreamable, solution may not be practical for RHEL6 due to QEMU console/display architecture. QXL though, is the only video device type in RHEL6 that can do multiple instances, so can't we do something that just bypasses vga_hw_screen_dump infrastructure.

eg, extend 'screendump' to take a device ID, fetch that device from the qdev tree, validate that it is a QXL device, and then just directly call into qxl_hw_screen_dump. Alternatively add a __com.redhat__screendump instead of changing the existing 'screendump' command.

Comment 6 Gerd Hoffmann 2011-06-01 08:13:22 UTC
Naa, it isn't *that* simple, qxl_hw_screen_dump() will not work on secondary displays as-is.  It should be doable though.

__com.redhat__qxl_screendump <pciaddress> <filename>

Does that look sane?

Comment 7 Daniel Berrangé 2011-06-01 08:27:34 UTC
I'd prefer it if the command took a qdev ID, rather than pciaddress, just because that's what most QEMU monitor commands use to identify devices. So given a command line:

  # qemu-kvm \
      -vga qxl -global qxl-vga.vram_size=33554432 \
      -device qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x4 \ 
      -device qxl,id=video2,vram_size=67108864,bus=pci.0,addr=0x5


in libvirt I'd carry on using 'screendump' for card 0 no matter what, but for additional heads use the custom command, with the qdev ID of the device. eg

 (qemu) screendump card0.pnm
 (qemu) __com.redhat__qxl_screendump video1 card1.pnm
 (qemu) __com.redhat__qxl_screendump video2 card2.pnm

Comment 8 Gerd Hoffmann 2011-06-07 15:58:34 UTC
scratch build for testing
https://brewweb.devel.redhat.com/taskinfo?taskID=3373785

Comment 9 Dave Allan 2011-06-10 16:11:45 UTC
*** Bug 701287 has been marked as a duplicate of this bug. ***

Comment 11 juzhang 2011-06-14 08:33:30 UTC
(In reply to comment #8)
> scratch build for testing
> https://brewweb.devel.redhat.com/taskinfo?taskID=3373785
Seems this build is closed now.

Tried with qemu-kvm-0.12.1.2-2.163.el6.x86_64, didn't find __com.redhat__qxl_screendump command. mark qa_ack+

when we verify this bug,we will according to comment6 & patch

Comment 13 Gerd Hoffmann 2011-06-15 12:17:15 UTC
most recent scratch build
https://brewweb.devel.redhat.com/taskinfo?taskID=3395786

Comment 21 Qunfang Zhang 2011-08-17 08:52:36 UTC
Verified this issue on qemu-kvm-0.12.1.2-2.183.el6, passed.

Steps:
1.Boot a windows guest with multiple monitor.
 /usr/libexec/qemu-kvm -m 2G -smp 4 -cpu cpu64-rhel6,+x2apic -drive
file=/home/win7-64-virtio.qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none
-device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0 -netdev
tap,id=hostnet0,script=/etc/qemu-ifup -device
rtl8139,netdev=hostnet0,mac=00:10:1a:3b:20:1f,bus=pci.0,addr=0x4 -boot dc -uuid
6d59434d-3f1c-4558-afc3-37e2cc430d6b -rtc-td-hack -no-kvm-pit-reinjection
-monitor stdio -name rhel6.1-32 -spice port=5930,disable-ticketing -vga qxl
-usb -k en-us -global qxl-vga.vram_size=33554432 -device
qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x5 -device
qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x6 -device
virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x7 -chardev
socket,id=channel0,host=127.0.0.1,port=12345,server,nowait -device
virtserialport,bus=virtio-serial0.0,nr=1,chardev=channel0,id=channel0,name=com.redhat.rhevm.vdsm
-chardev spicevmc,id=charchannel1,name=vdagent -device
virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0

2. Install qxl driver, virtio-serial driver, vdagent-win inside guest.

3. Right click on the desktop and bring up the display properties.
 - It should show 3 monitors now, and let you activate the display on the
second/third monitor.

4. Activate the second and third display by select the drop-down menu "extend desktop to this display".

5. Create some files/pictures and pull the files to the second/third display as well. Or open some windows and pull them to the second/third displays. That is to make sure the 3 monitors displays different content.

6. Capture the monitor with "screendump" and "__com.redhat_qxl_screendump" command.
 (qemu) screendump card0.pnm
 (qemu) __com.redhat__qxl_screendump video1 card1.pnm
 (qemu) __com.redhat__qxl_screendump video2 card2.pnm

7.Check the if the card*pnm pictures matches the 3 displays.

Result: The "screendump" and "__com.redhat_qxl_screendump" commands can capture multiple monitor screen.

So, this issue is fixed.

Comment 23 Qunfang Zhang 2011-08-18 08:00:47 UTC
Based on Comment 21,
Also test with the qmp command:

{"execute":"human-monitor-command","arguments":{"command-line","screendump card0_a.pnm"}}
{"error": {"class": "JSONParsing", "desc": "Invalid JSON syntax", "data": {}}}
}

{"execute":"__com.redhat_qxl_screendump","arguments":{"id":"video1","filename":"card1_a.pnm"}}
{"return": {}}


{"execute":"__com.redhat_qxl_screendump","arguments":{"id":"video2","filename":"card2_a.pnm"}}
{"return": {}}

The different monitors are captured correctly.

"screendump" command will be available in QMP soon according to bug 729969.

Comment 24 Gerd Hoffmann 2011-11-18 16:20:45 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    It is (was) impossible to make sccreenshots from secondary qxl displays.
Change
    A monitor command was added to fill the gap.

Comment 25 errata-xmlrpc 2011-12-06 15:41:29 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.

http://rhn.redhat.com/errata/RHSA-2011-1531.html


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