Bug 868843 - qemu should check if requested keymap is available
qemu should check if requested keymap is available
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
Depends On:
Blocks: 1011006
  Show dependency treegraph
Reported: 2012-10-22 05:29 EDT by hongming
Modified: 2013-09-23 09:22 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1011006 (view as bug list)
Last Closed: 2013-09-23 09:22:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description hongming 2012-10-22 05:29:43 EDT
Description of problem:
libvirt should check the setting keymap of spice device.If set it using any characters and numbers , the guest still can be started. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.# virsh dumpxml rhel6.3-new
  <graphics type='spice' port='5900' autoport='yes' listen='' keymap='fdshjlf78970'>
      <listen type='address' address=''/>

2.# virsh start rhel6.3-new
Domain rhel6.3-new started

3.# ps -ef|grep qemu-kvm
qemu     10532     1 55 17:26 ?        00:00:04 /usr/libexec/qemu-kvm -name 
serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -spice port=5900,addr=,disable-ticketing,seamless-migration=on -k fdshjlf78970 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device 

Actual results:
If set keymap of spice using any characters and numbers , the guest still can be started. 

Expected results:
libvirt should check the setting keymap of spice device.

Additional info:
Comment 2 Jiri Denemark 2012-10-22 06:13:52 EDT
libvirt has no idea what keymaps are supported by QEMU. QEMU itself should fail if it is asked to use a keymap which it doesn't support. Since qemu-kvm -k sadfdsfsdf fails as expected, it's likely that the error is somewhere in spice code, in which case qemu-kvm may not be the right component...
Comment 3 Markus Armbruster 2012-10-29 02:43:13 EDT
Quick check shows qemu-kvm fails as expected:
$ qemu-system-x86_64 -nodefaults --enable-kvm -S -vnc :0 -monitor stdio -k fdshjlf78970
Could not read keymap file: 'fdshjlf78970'

Reporter, please provide the full qemu-kvm command line.  You should be able to find it in libvirt logs.
Comment 4 hongming 2012-10-29 02:55:20 EDT
It should be "-spice ". In your command , it is "-vnc".

# ps -ef|grep rhel6.3
qemu     24730     1 46 14:46 ?        00:00:14 /usr/libexec/qemu-kvm -name rhel6.3 -S -M rhel5.4.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -uuid 9669ae9b-4996-b7e7-5648-53a6df93d5aa -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel6.3.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/kvm-rhel6.3-x86_64.img,if=none,id=drive-ide0-0-0,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=27,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:c5:20:41,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -spice port=5900,addr=,disable-ticketing,seamless-migration=on -k fdshjlf78970 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
Comment 5 Jiri Denemark 2012-10-29 03:03:57 EDT
Markus, the important part seems to be -spice option. If you try without it, qemu reports an error. However, with -spice, no error is reported and qemu starts just fine.
Comment 6 Markus Armbruster 2013-02-11 07:57:45 EST
As far as I can tell, we completely ignore -k with -spice.  Spice has no use for it, because it works with AT key codes.

We could reject use of -k together with -spice instead of ignoring it silently.
Comment 9 Ademar Reis 2013-09-23 09:22:21 EDT
WONTFIX for RHEL6. RHEL7 clone: 1011006

Note You need to log in before you can comment on or make changes to this bug.