Re: [Libvir] [PATCH] Keyboard layout support for QEMU/KVM

2008-01-15 Thread Daniel P. Berrange
On Tue, Jan 15, 2008 at 09:33:07AM +, Richard W.M. Jones wrote:
 Daniel Hokka Zakrisson wrote:
 This patch adds support for qemu's -k option, which is required to run
 virt-manager with a non-US keymap. Without it, keys are remapped a number
 of times, ending up with a completely unusable layout.
 
 Even with this patch I am having problems using the AltGr key, returning a
 scancode of 00. This seems to be a qemu problem though.
 
 Looks good, +1.

Ok, committed this.


Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] [PATCH] Keyboard layout support for QEMU/KVM

2008-01-14 Thread Daniel Hokka Zakrisson
This patch adds support for qemu's -k option, which is required to run
virt-manager with a non-US keymap. Without it, keys are remapped a number
of times, ending up with a completely unusable layout.

Even with this patch I am having problems using the AltGr key, returning a
scancode of 00. This seems to be a qemu problem though.

-- 
Daniel Hokka ZakrissonIndex: src/qemu_conf.c
===
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.26
diff -u -p -r1.26 qemu_conf.c
--- src/qemu_conf.c	14 Jan 2008 14:05:25 -	1.26
+++ src/qemu_conf.c	14 Jan 2008 17:55:33 -
@@ -218,6 +218,7 @@ void qemudFreeVMDef(struct qemud_vm_def 
 input = input-next;
 free(prev);
 }
+xmlFree(def-keymap);
 free(def);
 }
 
@@ -1245,6 +1246,7 @@ static struct qemud_vm_def *qemudParseXM
 else
 strcpy(def-vncListen, driver-vncListen);
 def-vncListen[BR_INET_ADDR_MAXLEN-1] = '\0';
+def-keymap = (char *) xmlGetProp(obj-nodesetval-nodeTab[0], BAD_CAST keymap);
 xmlFree(vncport);
 xmlFree(vnclisten);
 } else if (!strcmp((char *)prop, sdl)) {
@@ -1807,6 +1809,12 @@ int qemudBuildCommandLine(virConnectPtr 
 goto no_memory;
 if (!((*argv)[++n] = strdup(vncdisplay)))
 goto no_memory;
+if (vm-def-keymap) {
+if (!((*argv)[++n] = strdup(-k)))
+goto no_memory;
+if (!((*argv)[++n] = strdup(vm-def-keymap)))
+goto no_memory;
+}
 } else if (vm-def-graphicsType == QEMUD_GRAPHICS_NONE) {
 /* Nada - we added -nographic earlier in this function */
 } else {
@@ -2918,6 +2926,11 @@ char *qemudGenerateXML(virConnectPtr con
   def-vncListen)  0)
 goto no_memory;
 
+if (def-keymap 
+virBufferVSprintf(buf,  keymap='%s',
+  def-keymap)  0)
+goto no_memory;
+
 if (virBufferAdd(buf, /\n, -1)  0)
 goto no_memory;
 break;
Index: src/qemu_conf.h
===
RCS file: /data/cvs/libvirt/src/qemu_conf.h,v
retrieving revision 1.15
diff -u -p -r1.15 qemu_conf.h
--- src/qemu_conf.h	14 Jan 2008 14:05:25 -	1.15
+++ src/qemu_conf.h	14 Jan 2008 17:55:33 -
@@ -206,6 +206,7 @@ struct qemud_vm_def {
 int vncPort;
 int vncActivePort;
 char vncListen[BR_INET_ADDR_MAXLEN];
+char *keymap;
 
 int ndisks;
 struct qemud_vm_disk_def *disks;--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] [PATCH] Keyboard layout support for QEMU/KVM

2008-01-14 Thread Soren Hansen
On Mon, Jan 14, 2008 at 07:09:23PM +0100, Daniel Hokka Zakrisson wrote:
 This patch adds support for qemu's -k option, which is required to run
 virt-manager with a non-US keymap. Without it, keys are remapped a number
 of times, ending up with a completely unusable layout.
 
 Even with this patch I am having problems using the AltGr key, returning a
 scancode of 00. This seems to be a qemu problem though.

Note that a different solution to the same problem has been proposed by
Anthony Liguori.

   
http://sourceforge.net/mailarchive/forum.php?thread_name=478A6BFA.80009%40codemonkey.wsforum_name=gtk-vnc-devel

-- 
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/


signature.asc
Description: Digital signature
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] [PATCH] Keyboard layout support for QEMU/KVM

2008-01-14 Thread Daniel P. Berrange
On Mon, Jan 14, 2008 at 07:09:23PM +0100, Daniel Hokka Zakrisson wrote:
 This patch adds support for qemu's -k option, which is required to run
 virt-manager with a non-US keymap. Without it, keys are remapped a number
 of times, ending up with a completely unusable layout.
 
 Even with this patch I am having problems using the AltGr key, returning a
 scancode of 00. This seems to be a qemu problem though.

ACK, this patch looks good - gives parity with key handling in the Xen
driver.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] [PATCH] Keyboard layout support for QEMU/KVM

2008-01-14 Thread Daniel P. Berrange
On Mon, Jan 14, 2008 at 07:36:11PM +0100, Soren Hansen wrote:
 On Mon, Jan 14, 2008 at 07:09:23PM +0100, Daniel Hokka Zakrisson wrote:
  This patch adds support for qemu's -k option, which is required to run
  virt-manager with a non-US keymap. Without it, keys are remapped a number
  of times, ending up with a completely unusable layout.
  
  Even with this patch I am having problems using the AltGr key, returning a
  scancode of 00. This seems to be a qemu problem though.
 
 Note that a different solution to the same problem has been proposed by
 Anthony Liguori.
 

 http://sourceforge.net/mailarchive/forum.php?thread_name=478A6BFA.80009%40codemonkey.wsforum_name=gtk-vnc-devel

That's tangential. Daniel's patch is needed to support current real world
usage of QEMU/KVM.  Anthony's proposal is something for future impls.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list