Bug 1146801

Summary: sendkey: releasing order of combined keys was wrongly converse
Product: Red Hat Enterprise Linux 7 Reporter: Amos Kong <akong>
Component: qemu-kvm-rhevAssignee: Amos Kong <akong>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: ailan, flang, huding, juli, juzhang, knoel, kraxel, virt-maint, xfu
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.1.2-6.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:56:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Amos Kong 2014-09-26 06:14:38 UTC
Description of problem:

Commit 2e377f1730d06deafb3e3ef6cf88792de4a6f4df caused a new regression, the problem is same as Bug 949348, the releasing order of keys is wrong. It caused some combined keys don't work.

The commit only exists in qemu-kvm-rhev, not qemu-kvm-rhel7


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.1.0-4.el7

How reproducible:

Steps to Reproduce:
1. lunch a guest
2. execute showkey in guest
3. send keys in monitor
   (qemu) sendkey a-b-c

Actual results:
   press key1
   press key2
   press key3

   release key1
   release key2
   release key3

Expected results:
   press key1
   press key2
   press key3

   release key3
   release key2
   release key1

===============================================
commit 2e377f1730d06deafb3e3ef6cf88792de4a6f4df
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Wed May 28 13:03:37 2014 +0200

    input: use kbd delays for send_key monitor command

Comment 2 langfang 2014-09-26 07:04:39 UTC
Reproduce this bug as follow version:
# uname -r
3.10.0-167.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.0-4.el7.x86_64

guest:
rhel7

3.10.0-123.el7.x86_64

Steps;

1.Boot guest
# uname -r
3.10.0-167.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.0-4.el7.x86_64

Steps:
1.(qemu) sendkey a-b-c

In guest:

keyboard 28 release
keyboard 30 press
keyboard 48 press
keyboard 46 press
keyboard 30 release
keyboard 48 release
keyboard 46 release

Comment 3 Amos Kong 2014-09-26 07:59:59 UTC
Posted a fix to upstream: http://marc.info/?l=qemu-devel&m=141171750913046&w=2

[Qemu-devel] [PATCH] ui/input: correct the release order of combined keys

Comment 5 Miroslav Rezanina 2014-11-04 09:35:42 UTC
Fix included in qemu-kvm-rhev-2.1.2-6.el7

Comment 7 Jun Li 2014-11-12 06:34:19 UTC
Reproduce:
Version of components:
qemu-kvm-rhev-2.1.2-3.el7.x86_64

Steps:
1, boot guest with following cli:
# /usr/libexec/qemu-kvm -monitor stdio -drive file=/mnt/linux_img/RHEL-Server-7.1-64-virtio.qcow2,id=img,if=none,snapshot=on -device virtio-blk-pci,drive=img,id=sys-img -spice port=5931,disable-ticketing -m 2G -netdev tap,id=tap0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=tap0,mac=24:be:05:0c:11:11,id=net0 

2, execute "# showkey" inside guest.
# showkey

3. send keys in monitor
   (qemu) sendkey a-b-c

Actual results:
After step 3, will print following info inside guest:
keycode 30 press
keycode 48 press
keycode 46 press
keycode 30 release
keycode 48 release
keycode 46 release

As above show, this bz has been reproduced.
===============
Verify:
Version of components:
qemu-kvm-rhev-2.1.2-6.el7.x86_64

Steps:
1, boot guest with following cli:
# /usr/libexec/qemu-kvm -monitor stdio -drive file=/mnt/linux_img/RHEL-Server-7.1-64-virtio.qcow2,id=img,if=none,snapshot=on -device virtio-blk-pci,drive=img,id=sys-img -spice port=5931,disable-ticketing -m 2G -netdev tap,id=tap0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=tap0,mac=24:be:05:0c:11:11,id=net0 

2, execute "# showkey" inside guest.
# showkey

3. send keys in monitor
   (qemu) sendkey a-b-c

Actual results:
After step 3, will print following info inside guest:
keycode 30 press
keycode 48 press
keycode 46 press
keycode 46 release
keycode 48 release
keycode 30 release

As above show, this bz has been verified.

Comment 10 errata-xmlrpc 2015-03-05 09:56:07 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.

https://rhn.redhat.com/errata/RHSA-2015-0624.html