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 785963 - keys left pressed on the vncserver when closing the connection
Summary: keys left pressed on the vncserver when closing the connection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-31 03:05 UTC by daiwei
Modified: 2013-01-10 00:41 UTC (History)
11 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.258.el6
Doc Type: Bug Fix
Doc Text:
Cause: keys that were pressed when a VNC connection was closed were treated as pressed when the next VNC connection was opened. Consequence: after closing a VNC viewer with Alt+F4, the next connection would treat all keys as modified by Alt, until the Alt key was pressed and depressed again. Fix: QEMU will inject key-released events for all keys that were pressed at the time the VNC client disconnected Resolution: when closing a VNC viewer with Alt+F4, QEMU will inject a key-released event for Alt, so that the next connection will see a clean state.
Clone Of:
Environment:
Last Closed: 2012-06-20 11:38:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0746 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2012-06-19 19:31:48 UTC

Description daiwei 2012-01-31 03:05:14 UTC
Description of problem:
Using hotkey "Alt+F4" close vncviewer,then re-login guest by vncviewer.This vnc console become to no-response.

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-220.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.219.el6.x86_64
# rpm -q tigervnc
tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with vnc 
e.g.
# /usr/libexec/qemu-kvm -vnc :10 
2.login guest by vncviewer
e.g.
# vncviewer host_ip:port
3.close vncviewer by press hotkey "Alt+F4"
4.re-login guest by vncviewer
  
Actual results:
re-login successfully,but vncviewer become to no-response.
qemu doesn't report an error.

Expected results:
after re-login,vncviewer is response.

Additional info:
In upstream, qemu1.0 also has this problem.
Not find this problem in spice.

Comment 1 Dor Laor 2012-02-02 16:30:05 UTC
It seems like a problem in your setup.
I tested it on F16 and it worked nicely. The only exception to that is whether you caught the guest in a very specific transition and I doubt it happened.

Comment 2 daiwei 2012-02-03 03:16:32 UTC
Hi,Dor

   Do you mean your vnc client is on F16 then to connect a kvm guest?

   I also tested on F16 with vnc client:tigervnc-1.1.0-3.fc16.x86_64,always encounter this problem.

   After step 4,I can't type anything into vnc client even after waiting for a long time( > 1 hour).

   Any mistake,please correct me and free to close this issue.

Comment 3 juzhang 2012-02-03 03:19:27 UTC
Change bug status from closed to assigned in order to request needinfo

Comment 4 Dor Laor 2012-02-05 12:40:05 UTC
Can you request another QE person to re-test this on a different setup to validate the issue?

Comment 5 daiwei 2012-02-07 03:08:38 UTC
Hi,Dor

   Juzhang and Xiaomei Gao helped me to reproduce this bug,both of them can reproduce.
    Click shutdown button to close vnc client not have this problem.

Comment 6 Dor Laor 2012-02-07 10:51:42 UTC
Both Gleb and I managed to reproduce the issue (each separably). We see slightly different issue where after we close the vncclient w/ alt-f4 we can connect to it again but it seems that the vnc server in qemu has a mouse button or shift pressed and you can't operate the keyboard mouse well. 

Daiwei, cheers for insisting on this!

Comment 7 Dor Laor 2012-02-07 11:07:31 UTC
The above problem is caused because the 'alt' key remains pressed on the vncserver side. Once you reconnect w/ a new vnc-client, if you 'play' a lot w/ the 'alt' key, it gets back to normal.

Comment 9 Gerd Hoffmann 2012-02-08 08:49:04 UTC
I guess it is any key, not just alt, it is just that alt has a very
noticable effect ;)

Workaround is easy: just tap alt once and things return to normal.
Fix most likely is easy too, qemu already keeps track of pressed keys,
we just have to eject key-up events into the guest on vnc disconnect.

Comment 10 Dor Laor 2012-02-08 09:21:48 UTC
(In reply to comment #9)
> I guess it is any key, not just alt, it is just that alt has a very
> noticable effect ;)
> 
> Workaround is easy: just tap alt once and things return to normal.
> Fix most likely is easy too, qemu already keeps track of pressed keys,
> we just have to eject key-up events into the guest on vnc disconnect.

Yonit said that spice resets all the special keys on client disconnect. Seems like vnc should do the same

Comment 11 Gerd Hoffmann 2012-02-08 12:30:01 UTC
http://patchwork.ozlabs.org/patch/140132/

Comment 12 Gerd Hoffmann 2012-02-17 11:23:16 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=4053507
patches posted.

Comment 16 langfang 2012-04-09 03:24:08 UTC
reporduce this issue with steps and  environment as follows:
#uname -r 
2.6.32-257.el6.x86_64
#rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.256.el6.x86_64

steps:
1)boot guest with vnc 
/usr/libexec/qemu-kvm -m 2G -smp 1 -cpu Penryn,+x2apic, -usbdevice tablet -drive file=/mnt/RHEL-Server-6.3-64-virtio.qcow2-newinstall5,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=00:10:20:2d:31:21,bus=pci.0,addr=0x4,id=net0 -boot order=cdn,once=n,menu=on -uuid 043b28a2-f400-4538-9d29-c30588a08709 -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -monitor stdio -name rhel6.1 -vnc :10 -device virtio-balloon-pci,bus=pci.0,id=balloon0
2) after login guest 
run some operation in guest ,guest can be work normally
3)close vncviewer by press hotkey "Alt+F4"
4)relogin guest by vncviewer

results:
 can't type anything into vnc client,vncviewer become to no-response.

verify this issue with steps and  environment as follows:

#uname -r 
2.6.32-257.el6.x86_64
#rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.262.el6.x86_64
steps:
the same as reproduce

results: vncviewer work well.so the issue has been fixed.

Comment 18 Michal Novotny 2012-05-04 09:49:51 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:
No Documentation Needed

Comment 19 Paolo Bonzini 2012-05-04 12:21:59 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,7 @@
-No Documentation Needed+Cause: keys that were pressed when a VNC connection was closed were treated as pressed when the next VNC connection was opened.
+
+Consequence: after closing a VNC viewer with Alt+F4, the next connection would treat all keys as modified by Alt, until the Alt key was pressed and depressed again.
+
+Fix: QEMU will inject key-released events for all keys that were pressed at the time the VNC client disconnected
+
+Resolution: when closing a VNC viewer with Alt+F4, QEMU will inject a key-released event for Alt, so that the next connection will see a clean state.

Comment 20 errata-xmlrpc 2012-06-20 11:38:51 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/RHBA-2012-0746.html


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