Bug 808661

Summary: Only one can be received when sent multiple duplicate key-codes to the guest.
Product: Red Hat Enterprise Linux 6 Reporter: lei wang <leiwan>
Component: libvirtAssignee: Gunannan Ren <gren>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, ajia, dallan, dyasny, dyuan, gsun, mzhan, rwu, whuang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-03 16:37:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description lei wang 2012-03-31 05:13:21 UTC
Description of problem: 
Only one can be received when sent multiple duplicate key-codes to the guest.

Version-Release number of selected component (if applicable):
kernel-2.6.32-251.el6
libvirt-0.9.10-6.el6
netcf-0.1.9-2.el6
qemu-kvm-0.12.1.2-2.251.el6

How reproducible:
always

Steps to Reproduce:
1.#virsh send-key<domain>  0x10 0x11 0x10
	==>the "qwq" will be shown on guest console, it's a expected result.
2.#virsh send-key<domain>  16 17 16
	==>the "qwq" will be shown on guest console, it's a expected result.
3.#virsh send-key<domain>  0x10 0x10 0x10
	==>the "q" will be shown on guest console, it's a unexpected result.
4.#virsh send-key<domain>  16 16 16
	==>the "q" will be shown on guest console, it's a unexpected result.

Actual results:
Guest console can receive multiple duplicate key-codes.

Expected results:
Only one can be received when sent multiple duplicate key-codes to the guest.

Comment 3 Gunannan Ren 2012-04-03 13:48:53 UTC
The sendkey command in qemu is to emulate keyboard events. Use - to press several keys simultaneously for combination key events(such as ctl-alt-f1). If you want to press multiple duplicated key-codes, the effect is the same as the case that only one key is pressed, so it makes sense to give only one letter in your cases in guest.

BTW, when I tried it by hand in qemu-kvm monitor console, the result is like what I said above. so I don't think this is a bug in both libvirt and qemu.
If I am wrong, this is not a libvirt bug at least.

Comment 4 Dave Allan 2012-04-03 13:56:11 UTC
Guannan, that makes sense.  So what would the correct command be to send multiple keystrokes, for example, if a user wanted to send the string "qqq" or "reboot" ?

Comment 5 Gunannan Ren 2012-04-03 14:08:25 UTC
I think if we still want to use sendkey to do that, we could invoke the command with the same letter multiple times.like the follows for "qqq"
virsh send-key <domain> 0x10
virsh send-key <domain> 0x10
virsh send-key <domain> 0x10
Or use virtio-serial for data messaging between host and guest.

Comment 6 Dave Allan 2012-04-03 16:37:16 UTC
Thanks, Guannan.  Given that, I am closing as NOTABUG.