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:
Created attachment 367117 [details] fix (upstream).
Patch submitted to qemu-devel.
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
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
(In reply to comment #7) > CapsLK is still off automatically during booting when view guest with spice > plugin. --> new bug 557677
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.
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.
Raising Regression keyword based on Comment #11.
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.
Patches have been committed upstream now, will prepare rhel5 backports.
posted to rhvirt-patches
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`
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