Bug 1251836

Summary: guest can't accept all keys which send by send-key command while login guest with level 5
Product: Red Hat Enterprise Linux 7 Reporter: zhenfeng wang <zhwang>
Component: qemu-kvm-rhevAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: dyuan, fjin, hhuang, huding, juzhang, knoel, mazhang, mzhan, rbalakri, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-15 08:12:02 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:
Embargoed:

Description zhenfeng wang 2015-08-10 06:09:37 UTC
Description of problem:
guest can't accept all keys which send by send-key command while login guest with level 5

Pkg info
libvirt-1.2.17-3.el7.x86_64
qemu-kvm-rhev-2.3.0-15.el7.x86_64
kernel-3.10.0-302.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a running guest with graphical desktop installing
host# virsh list
 Id    Name                           State
----------------------------------------------------
 24    virt-tests-vm1              running

2.Login guest with level 5, then try to use the send-key to crete a file in the guest,
if the following command run successfully, it should touch a file named abc in the guest,
however didn't get the file named abc in guest but get a file name ab insie the guest

host#virsh send-key virt-tests-vm1 --codeset linux 20 24 22 46 35 57 30 48 46 28

# echo $?
0

login the guest
guest# ll abc
ls: cannot access abc: No such file or directory

guest# ll ab
guest# ll ab
-rw-r--r--. 1 root root 0 Aug  7 17:56 ab

3.login guest with level 3, then re-send the key, could get a file named abc inside guest expectly
guest#init 3
host#virsh send-key virt-tests-vm1 --codeset linux 20 24 22 46 35 57 30 48 46 28
guest# ll abc
-rw-r--r--. 1 root root 0 Aug  7 18:04 abc
 
Actual results:
guest can't accept all keys which send by send-key command while login guest with level 5

Expected results:
Guest should accespt all keys while login guest with both level 3 and level 5

Comment 2 Peter Krempa 2015-08-10 09:06:19 UTC
*** Bug 1241349 has been marked as a duplicate of this bug. ***

Comment 3 Peter Krempa 2015-08-10 09:11:06 UTC
Since the behavior changes depending on guest state the bug is probably either in the sending of the event from the emulated hardware or in the guest kernel that is interpreting it. Moving to qemu for further triage.

Comment 5 Gerd Hoffmann 2015-09-15 08:12:02 UTC
(In reply to zhenfeng wang from comment #0)
> Description of problem:
> guest can't accept all keys which send by send-key command while login guest

send-key is for single keys.  Don't try to send key sequences with it.

Specifying multiple keys in one send-key command is for key combinations like 'ctrl-alt-del' or 'shift-a', not for sending strings.