Bug 517814 - Caps Lock the key's appearance of guest is not synchronous as host's --view kvm with vnc
Summary: Caps Lock the key's appearance of guest is not synchronous as host's --view ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kvm
Version: 5.6
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Lawrence Lim
URL:
Whiteboard:
Depends On:
Blocks: 569767 1017019
TreeView+ depends on / blocked
 
Reported: 2009-08-17 10:42 UTC by Qunfang Zhang
Modified: 2014-03-26 01:00 UTC (History)
10 users (show)

Fixed In Version: kvm-83-165.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 552612 569767 1017019 (view as bug list)
Environment:
Last Closed: 2011-01-13 23:11:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fix (upstream). (1.71 KB, text/plain)
2009-11-02 11:48 UTC, Gerd Hoffmann
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0028 0 normal SHIPPED_LIVE Low: kvm security and bug fix update 2011-01-13 11:03:39 UTC

Description Qunfang Zhang 2009-08-17 10:42:01 UTC
Description of problem:
(1)view kvm with vnc: Caps Lock is on before booting guest, input character in
guest when caps lock still on, but output is lowercase letter. Guest keyboard
inputmethod is not synchronous with host.

(2)view kvm with spice: Caps Lock is on before booting guest, but when guest is
booting, the caps lock will be off automatically.

(3)This issue occurs on both rhel and Windows guests.

CLI:

/usr/libexec/qemu-kvm  -usbdevice tablet  -smp 2  -m 1024 -net nic,vlan=0,macaddr=00:1a:4a:01:22:37,model=rtl8139  -net tap,vlan=0,script=/etc/qemu-ifup -drive file=/mnt/rhel-5.4-32.raw,media=disk,if=ide,cache=off  -cpu qemu64,+sse2 -uuid 1910c9d7-11c7-47c0-87e0-9952b8243275 -monitor stdio -vnc :10 -boot c


/usr/libexec/qemu-kvm -usbdevice tablet  -smp 2  -m 1024 -net nic,vlan=0,macaddr=00:1a:4a:01:22:37,model=rtl8139  -net tap,vlan=0,script=/etc/qemu-ifup -drive file=/mnt/rhel-5.4-32.raw,media=disk,if=ide,cache=off  -cpu qemu64,+sse2 -uuid 1910c9d7-11c7-47c0-87e0-9952b8243275 -monitor stdio  -boot c  -spice
host=0,ic=on,port=5930,disable-ticketing -qxl 1 -balloon none

Version-Release number of selected component (if applicable):
#uname -a
2.6.18-162.el5
#rpm -q kvm
kvm-83-105

How reproducible:
100%

Steps to Reproduce:
1.Boot a vm with vnc parameter, Caps Lock is on before booting vm.
2.Input some character in guest's terminal or notepad with Caps Lock still on.
3.Boot a vm with spice parameter, Caps Lock is on before booting vm.
4.Input some character in guest's terminal or notepad.
  
Actual results:
After step 2,Caps Lock is on but keyboard output is lowercase letter.
After step 3,the caps lock will be off automatically.
After step 4.Caps Lock is off automatically so output is lowercase letter.

Expected results:
Guest keyboard inputmethod should be synchronous with host all the time.

Additional info:

Comment 1 Gerd Hoffmann 2009-11-02 11:48:29 UTC
Created attachment 367117 [details]
fix (upstream).

Comment 2 Gerd Hoffmann 2009-11-02 11:49:30 UTC
Patch submitted to qemu-devel.

Comment 3 Gerd Hoffmann 2010-01-05 16:32:45 UTC
Patch got committed to qemu git repo:

http://git.qemu.org/qemu.git/commit/?id=6b1325029d80455b9da7cd7bd84a88cb915b867c

Turned out an additional patch is needed:

http://git.qemu.org/qemu.git/commit/?id=4a93fe17081c7ae7f4d5607b266ca384d328986c

Comment 7 Suqin Huang 2010-01-18 08:30:13 UTC
CapsLK is still off automatically during booting when view guest with spice plugin.

1. turn on CapsLK
2. boot guest
3. view guest with spice :
#spicec ip port 

CLI:

/usr/libexec/qemu-kvm  -smp 2 -m 2G -drive file=/root/rhel5.4-64-virtio.bak,media=disk,if=ide,cache=off,index=0,serial=fb-bde1-8bcf10f72b98 -net nic,vlan=0,macaddr=00:65:4a:01:00:37,model=rtl8139 -net tap,vlan=0,script=/etc/qemu-ifup  -uuid `uuidgen` -no-hpet   -rtc-td-hack  -startdate now -cpu qemu64,+sse2  -monitor stdio -spice host=0,ic=on,port=5930,disable-ticketing  -qxl 1  -name 5.4-64

kvm
[root@s157 ~]# uname -r
2.6.18-183.el5
[root@s157 ~]# rpm -qa | grep kvm
kvm-tools-83-147.el5
kvm-83-147.el5
etherboot-zroms-kvm-5.4.4-13.el5
kvm-debuginfo-83-147.el5
etherboot-roms-kvm-5.4.4-13.el5
kvm-qemu-img-83-147.el5
kmod-kvm-83-147.el5

Comment 8 lihuang 2010-01-24 16:55:37 UTC
(In reply to comment #7)
> CapsLK is still off automatically during booting when view guest with spice
> plugin.

--> new bug 557677

Comment 9 Suqin Huang 2010-01-27 01:38:30 UTC
CapsLk and Numeric keypad work when view guest with vnc:

1. turn on CapsLk, Num Lock
2. Boot guest
3. Input some text on guest.

output is upper case, Numeric keypad works

1. turn off CapsLk, Num Lock 
2. Boot guest
3. Input some text on guest.
output is lower case, can not input nums via Numeric keypad.

Comment 11 Miya Chen 2010-01-28 10:01:42 UTC
This fix has some bad effects with vnc connection:
1. Boot a windows 2008 guest with vnc, Caps Lock is off before booting vm.
2. It always prompts that "Caps Lock is on" in windows 2008 guest login window when pressing "shift + character key".
3. Input some character in guest's  notepad, got lowercase letter.
4. Logout guest and then relogin, you will found the charater you input in login windows is uppercase.


This problem does not exist in the version before kvm-83-147, so open it again.

Comment 14 Lawrence Lim 2010-03-02 02:03:10 UTC
Raising Regression keyword based on Comment #11.

Comment 16 Gerd Hoffmann 2010-03-02 10:58:03 UTC
Qemu has the pretty fundamental issue that it simply doesn't track the guests keyboard led (and thereby capslock and numlock) state.  So until the this is implemented it can't be fixed for real and anything which improves things in one case can cause regressions in another case.

Spice in RHEL-5.5 gets away with hooking directly into the ps/2 keyboard emulation.

For RHEL-6.0 and merging spice upstream work has been done to make qemu track the keyboard led state and also use this to fix the numlock/capslock tracking for vnc.  Patches have been submitted upstream, but as of today they are not merged yet.

http://patchwork.ozlabs.org/patch/46357/
http://patchwork.ozlabs.org/patch/46354/
http://patchwork.ozlabs.org/patch/46356/
http://patchwork.ozlabs.org/patch/46355/

Backporting them to RHEL-5 is possible.  The patches are non-trivial though, so I'd suggest to do this for 5.6 so the patches can get more testing in both upstream qemu and Red Hat QA.

Comment 17 Gerd Hoffmann 2010-03-12 10:36:34 UTC
Patches have been committed upstream now, will prepare rhel5 backports.

Comment 18 Gerd Hoffmann 2010-03-12 13:04:08 UTC
posted to rhvirt-patches

Comment 21 Golita Yue 2010-04-09 05:45:57 UTC
CapsLk and Numeric keypad work well when view guest with vnc:
Tested both in RHEL-Server-5.4-32 and win2008-64.

1. turn on CapsLock, NumLock
2. Boot guest
3. Input some text on guest.
output is upper case, Numeric keypad works

1. turn off CapsLock, NumLock 
2. Boot guest
3. Input some text on guest.
output is lower case, Numeric keypad works

1. Boot a windows 2008 guest with vnc, Caps Lock is off before booting vm.
2. Input some text on guest
3. output is lower case, Numeric keypad works well
4. turen on Caps Lock and input some text
5. output is upper case
4. Logout guest and then relogin to check the before added text, it is as same as previous contect. 

kernel 
# uname -r 
2.6.18-194.el5
kvm 
kvm-83-165.el5

cmd:
/usr/libexec/qemu-kvm -no-hpet -usbdevice tablet -rtc-td-hack -startdate now -cpu qemu64,+sse2 -drive file=/mnt/RHEL-Server-5.4-32-virtio.raw,if=ide,cache=off -net nic,macaddr=20:20:11:23:22:03,vlan=0,model=virtio -net tap,vlan=0,script=/etc/qemu-ifup -vnc :1 -m 2G -smp 2 -boot c -monitor stdio -uuid `uuidgen`

/usr/libexec/qemu-kvm -no-hpet -usbdevice tablet -rtc-td-hack -startdate now -cpu qemu64,+sse2 -drive file=/mnt/win2008-64-virtio.raw,if=ide,cache=off -net nic,macaddr=20:20:11:23:22:03,vlan=0,model=virtio -net tap,vlan=0,script=/etc/qemu-ifup -vnc :1 -m 2G -smp 2 -boot c -monitor stdio -uuid `uuidgen`

Comment 25 errata-xmlrpc 2011-01-13 23:11:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

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


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