Description of problem: Failed to take screenshot for guest Version-Release number of selected component (if applicable): libvirt-daemon-6.6.0-4.module+el8.3.0+7883+3d717aa8.x86_64 qemu-kvm-5.1.0-4.module+el8.3.0+7846+ae9b566f.x86_64 How reproducible: 100% Steps to Reproduce: 1.Edit guest with qxl video and vnc graphical device: #virsh edit vm1 ... <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> <video> ... <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... 2.Start guest: #virsh start vm1 3.Connect guest with remote-viewer: # remote-viewer vnc://*.*.*.com:5902 4.Take screenshot for guest: ## virsh screenshot vm1 --file /tmp/screen.ppm error: could not receive data from domain vm1 error: recv handler failed: Bad file descriptor Actual results: Failed to take screenshot for guest Expected results: Should take screenshot for guest successfully. Additional info: 1.It works well with libvirt-6.0.0-28.module+el8.3.0+7827+5e65edd7.x86_64: # virsh screenshot vm1 /tmp/screen0 Screenshot saved to /tmp/screen0, with type of image/x-portable-pixmap
git bisect points to: commit 9e745a97171e10f050962c166082439d6724e245 virsh: Pass virshStreamCallbackDataPtr to virshStreamSink() and virshStreamSkip() git describe: v6.6.0-565-g9e745a9717 contains: v6.7.0-rc1~73
Upstream patch: https://www.redhat.com/archives/libvir-list/2020-September/msg00487.html
Fixed upstream by: commit 3144e881b137123b0326157ce6dc23ca649c9270 Author: Ján Tomko <jtomko> CommitDate: 2020-09-09 14:37:19 +0200 virsh: cmdScreenshot: fix cbdata passing to virshStreamSink The changes for sparse stream support started passing virshStreamCallbackDataPtr to virshStreamSink instead of passing a simple file descriptor, but forgot to adjust all the callers. Fix it in cmdScreenshot as well. https://bugzilla.redhat.com/show_bug.cgi?id=1875195 Signed-off-by: Ján Tomko <jtomko> Fixes: 9e745a97171e10f050962c166082439d6724e245 Reviewed-by: Martin Kletzander <mkletzan> git describe: v6.7.0-111-g3144e881b1
Downstream backport: http://post-office.corp.redhat.com/archives/rhvirt-patches/2020-September/msg00122.html
Verified with libvirt-6.6.0-6.module+el8.3.0+8125+aefcf088.x86_64. Test steps: 1.Edit guest with qxl video and vnc graphical device: #virsh edit vm1 ... <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> <video> ... <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... 2.Start guest: #virsh start vm1 3.Connect guest with remote-viewer: # remote-viewer vnc://*.*.*.com:5902 4.Take screenshot for guest: #virsh screenshot vm1 --file /tmp/screen.ppm Screenshot saved to /tmp/screen.ppm, with type of image/x-portable-pixmap 5.Also test screenshot for 2 videos, it also works well.
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 (virt:8.3 bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2020:5137