Red Hat Bugzilla – Bug 705070
QMP: screendump command does not allow specification of monitor to capture
Last modified: 2011-12-06 10:41:29 EST
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:
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.
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.
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?
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
scratch build for testing https://brewweb.devel.redhat.com/taskinfo?taskID=3373785
*** Bug 701287 has been marked as a duplicate of this bug. ***
(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
most recent scratch build https://brewweb.devel.redhat.com/taskinfo?taskID=3395786
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.
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.
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.
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