Bug 1018668 - screenshot command does not take effect immediately agaist a VM with UI desktop window.
Summary: screenshot command does not take effect immediately agaist a VM with UI deskt...
Keywords:
Status: CLOSED DUPLICATE of bug 1230527
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Virtualization Maintenance
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
: 1651843 (view as bug list)
Depends On: 1230527
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-14 07:00 UTC by zhengqin
Modified: 2020-12-15 07:46 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 06:01:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhengqin 2013-10-14 07:00:52 UTC
Description of problem:
virsh screenshot <domain> could not take effect immediately

Version-Release number of selected component (if applicable):
virt-manager-0.10.0-4.el7.noarch
libvirt-1.1.1-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create and open a RHEL6.5 VM with Graphic Interface UI from virt-manager, and then open a gnome-terminal window in this VM.
2. From the host machine, issue following command to check screenshot function:
#virsh send-key <domainVM> KEY_E KEY_C KEY_H KEY_O KEY_SPACE KEY_F KEY_I KEY_R KEY_S KEY_T KEY_ENTER ; virsh screenshot <domainVM> first.ppm



Actual results:
Empty gnome-terminal window display in screenshot first.ppm

Expected results:
The key "echo first" and a new line with "first" should be displayed in screenshot first.ppm

Additional info:
1. This issue does not occur on latest RHEL6.5 Host environment;
2. This issue does not occur with button "Take Screenshot" from VM Windows in Virtual Manager;
3. This issue also occurs if you wait some times before taking screenshot in reproduce step 2 just like issue following command:
#virsh send-key <domainVM> KEY_E KEY_C KEY_H KEY_O KEY_SPACE KEY_F KEY_I KEY_R KEY_S KEY_T KEY_ENTER ;    sleep 30 ;   virsh screenshot <domainVM> first.ppm
4. This issue occurs agaist both on a VM with KDE and GNOME desktop environment.
5. This issue does not occur agaist a VM without graphic interface.

Comment 1 Giuseppe Scrivano 2014-06-18 11:41:13 UTC
I get the same error using this command (that is what the virsh screenshot command does behind the scenes):

virsh send-key $VM_NAME KEY_E KEY_C KEY_H KEY_O KEY_SPACE KEY_A KEY_ENTER; sleep 30; virsh qemu-monitor-command $VM_NAME '{"execute":"screendump", "arguments": { "filename": "/tmp/foo.ppm"}}'

I am reassigning to qemu for further probing of this issue.

Comment 2 Gerd Hoffmann 2014-06-19 13:00:25 UTC
Test case isn't valid.  There is no guarantee that the guest has successfully processed the key presses by the time the screenshot command is executed.

Nevertheless there is a known issue with qxl due to spice-server doing local rendering asynchronously.  stdvga and cirrus don't have this problem.  Fix is non-trivial because monitor can't sleep & wait.

Comment 6 Gerd Hoffmann 2016-04-15 12:03:56 UTC
Marc-André kicked async monitor discussion upstream recently:

https://lists.nongnu.org/archive/html/qemu-devel/2015-07/msg05825.html

Adding him to Cc:

Comment 7 Gerd Hoffmann 2016-06-13 15:14:16 UTC
not solved yet upstream -> defer to 7.4

Comment 8 Gerd Hoffmann 2017-01-09 14:54:32 UTC
> not solved yet upstream -> defer to 7.4
same again.  Not solved, nobody working on it, very unlikely to make 7.4

Comment 9 Gerd Hoffmann 2018-06-13 11:13:47 UTC
Looks like we have async monitor some progress upstream,
block-jobs evolving into generic jobs.

Need to check whenever this actually helps with this issue.
Also merged upstream after 2.12, so not available for 7.6.
Most likely this will be deferred again ...

Comment 13 Gerd Hoffmann 2018-12-05 10:23:09 UTC
*** Bug 1651843 has been marked as a duplicate of this bug. ***

Comment 16 Gerd Hoffmann 2019-03-05 07:16:51 UTC
Moving to advanced virt.

Comment 17 Ademar Reis 2020-02-05 22:41:46 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 18 Gerd Hoffmann 2020-02-06 07:05:39 UTC
Not sure how to classify this one, picked graphics for now, but maybe qmp fits better ...
Upstream status: seems we are pretty close to actually getting async monitor commands (using coroutines).
With some good luck 5.1 will finally fix this one.

Comment 19 Gerd Hoffmann 2020-02-06 07:08:58 UTC
https://patchwork.ozlabs.org/patch/1222167/

Comment 24 RHEL Program Management 2020-12-15 06:01:14 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 25 Guo, Zhiyi 2020-12-15 06:34:47 UTC
Hi Gerd,

   I see the fix of this problem has been already addressed by Bug 1230527 - For a windows guest using spice, sceenshot has to be taken twice continually to get the current screen. The fix:
commit 0d9b90ce5c73505648909a89bcd5272081b9c348
Author: Marc-André Lureau <marcandre.lureau>
Date:   Tue Oct 27 17:36:02 2020 +0400

    console: make QMP/HMP screendump run in coroutine
    
    Thanks to the monitors' coroutine support (merge commit b7092cda1b3),
    the screendump handler can trigger a graphic_hw_update(), yield and let
    the main loop run until update is done. Then the handler is resumed, and
    ppm_save() will write the screen image to disk in the coroutine context.
    
    The IO is still blocking though, as the file is set blocking so far,
    this could be addressed by some future change (with other caveats).
    
    Related to:
    https://bugzilla.redhat.com/show_bug.cgi?id=1230527
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau>
    Reviewed-by: Gerd Hoffmann <kraxel>
    Reviewed-by: Markus Armbruster <armbru>
    Message-id: 20201027133602.3038018-4-marcandre.lureau
    Signed-off-by: Gerd Hoffmann <kraxel>

Can I mark this bug as a dup of Bug 1230527? Thx!

Zhiyi

Comment 26 Gerd Hoffmann 2020-12-15 07:01:37 UTC
> 
> Can I mark this bug as a dup of Bug 1230527? Thx!
> 
yes, it is the same underlying issue.

Comment 27 Guo, Zhiyi 2020-12-15 07:46:14 UTC

*** This bug has been marked as a duplicate of bug 1230527 ***


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