Hide Forgot
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.
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.
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" ?
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.
Thanks, Guannan. Given that, I am closing as NOTABUG.