[pve-devel] r5704 - pve-kernel-2.6.18/trunk/kvmdeb/patches

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Mar 15 08:30:05 CET 2011


Author: dietmar
Date: 2011-03-15 08:30:05 +0100 (Tue, 15 Mar 2011)
New Revision: 5704

Modified:
   pve-kernel-2.6.18/trunk/kvmdeb/patches/adjust-path.diff
   pve-kernel-2.6.18/trunk/kvmdeb/patches/disable-signaldf.patch
   pve-kernel-2.6.18/trunk/kvmdeb/patches/fairsched.diff
   pve-kernel-2.6.18/trunk/kvmdeb/patches/fix-ksm-install.diff
   pve-kernel-2.6.18/trunk/kvmdeb/patches/keymap.diff
   pve-kernel-2.6.18/trunk/kvmdeb/patches/kvm-vma-fix.diff
   pve-kernel-2.6.18/trunk/kvmdeb/patches/vncticket.diff
Log:


Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/adjust-path.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/adjust-path.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/adjust-path.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,7 +1,7 @@
-Index: kvm-test/qemu/configure
+Index: kvm-src/qemu/configure
 ===================================================================
---- kvm-test.orig/qemu/configure	2010-04-15 07:57:44.000000000 +0200
-+++ kvm-test/qemu/configure	2010-04-15 07:58:36.000000000 +0200
+--- kvm-src.orig/qemu/configure	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/configure	2011-03-15 07:30:27.000000000 +0100
 @@ -1327,8 +1327,8 @@
        prefix="/usr/local"
    fi
@@ -13,10 +13,10 @@
    binsuffix="/bin"
  fi
  
-Index: kvm-test/qemu/net.h
+Index: kvm-src/qemu/net.h
 ===================================================================
---- kvm-test.orig/qemu/net.h	2010-04-15 07:57:43.000000000 +0200
-+++ kvm-test/qemu/net.h	2010-04-15 07:58:36.000000000 +0200
+--- kvm-src.orig/qemu/net.h	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/net.h	2011-03-15 07:30:27.000000000 +0100
 @@ -116,8 +116,8 @@
  void net_host_device_add(const char *device, const char *opts);
  void net_host_device_remove(int vlan_id, const char *device);

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/disable-signaldf.patch
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/disable-signaldf.patch	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/disable-signaldf.patch	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,7 +1,7 @@
 Index: kvm-src/qemu/configure
 ===================================================================
---- kvm-src.orig/qemu/configure	2010-10-11 10:31:16.000000000 +0200
-+++ kvm-src/qemu/configure	2010-10-11 10:32:03.000000000 +0200
+--- kvm-src.orig/qemu/configure	2011-03-15 07:30:27.000000000 +0100
++++ kvm-src/qemu/configure	2011-03-15 07:30:59.000000000 +0100
 @@ -1236,33 +1236,6 @@
    fi
  fi

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/fairsched.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/fairsched.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/fairsched.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,7 +1,7 @@
-Index: kvm-test/qemu/vl.c
+Index: kvm-src/qemu/vl.c
 ===================================================================
---- kvm-test.orig/qemu/vl.c	2010-04-14 10:14:18.000000000 +0200
-+++ kvm-test/qemu/vl.c	2010-04-14 10:24:24.000000000 +0200
+--- kvm-src.orig/qemu/vl.c	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/vl.c	2011-03-15 07:30:36.000000000 +0100
 @@ -47,6 +47,7 @@
  #include "kvm.h"
  #include "balloon.h"
@@ -18,7 +18,7 @@
  int smp_cpus = 1;
  int smp_cores = 1;
  int smp_threads = 1;
-@@ -4502,6 +4504,8 @@
+@@ -4571,6 +4573,8 @@
      QEMU_OPTION_usb,
      QEMU_OPTION_usbdevice,
      QEMU_OPTION_smp,
@@ -27,7 +27,7 @@
      QEMU_OPTION_vnc,
      QEMU_OPTION_no_acpi,
      QEMU_OPTION_no_hpet,
-@@ -4654,6 +4658,8 @@
+@@ -4723,6 +4727,8 @@
      { "no-rtc-td-hack", 0, QEMU_OPTION_no_rtc_td_hack },
      { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
      { "smp", HAS_ARG, QEMU_OPTION_smp },
@@ -36,7 +36,7 @@
      { "vnc", HAS_ARG, QEMU_OPTION_vnc },
  #ifdef CONFIG_CURSES
      { "curses", 0, QEMU_OPTION_curses },
-@@ -5142,6 +5148,7 @@
+@@ -5211,6 +5217,7 @@
  #endif
      uint32_t boot_devices_bitmap = 0;
      int i;
@@ -44,7 +44,7 @@
      int snapshot, linux_boot, net_boot;
      const char *initrd_filename;
      const char *kernel_filename, *kernel_cmdline;
-@@ -5828,6 +5835,20 @@
+@@ -5897,6 +5904,20 @@
                      exit(1);
                  }
                  break;
@@ -65,7 +65,7 @@
  	    case QEMU_OPTION_vnc:
  		vnc_display = optarg;
  		break;
-@@ -6077,6 +6098,39 @@
+@@ -6146,6 +6167,39 @@
          exit(1);
      }
  
@@ -105,10 +105,10 @@
  #ifdef USE_KQEMU
      if (smp_cpus > 1)
          kqemu_allowed = 0;
-Index: kvm-test/qemu/vzsyscalls.h
+Index: kvm-src/qemu/vzsyscalls.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ kvm-test/qemu/vzsyscalls.h	2010-04-14 10:23:16.000000000 +0200
++++ kvm-src/qemu/vzsyscalls.h	2011-03-15 07:30:36.000000000 +0100
 @@ -0,0 +1,47 @@
 +/*
 + *  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/fix-ksm-install.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/fix-ksm-install.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/fix-ksm-install.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,7 +1,7 @@
 Index: kvm-src/kernel/Makefile
 ===================================================================
---- kvm-src.orig/kernel/Makefile	2010-03-08 08:40:37.000000000 +0100
-+++ kvm-src/kernel/Makefile	2010-03-08 10:18:19.000000000 +0100
+--- kvm-src.orig/kernel/Makefile	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/kernel/Makefile	2011-03-15 07:30:55.000000000 +0100
 @@ -12,8 +12,7 @@
  
  MAKEFILE_PRE = $(ARCH_DIR)/Makefile.pre
@@ -12,7 +12,7 @@
  
  rpmrelease = devel
  
-@@ -116,11 +115,6 @@
+@@ -119,11 +118,6 @@
  ifndef SKIP_KSM
  	cp ksm/*.ko $(DESTDIR)/$(INSTALLDIR)
  endif

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/keymap.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/keymap.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/keymap.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,482 +1,75 @@
-Index: kvm-test/qemu/keymaps.c
+Index: kvm-src/qemu/vnc.c
 ===================================================================
---- kvm-test.orig/qemu/keymaps.c	2009-01-20 11:03:25.000000000 +0100
-+++ kvm-test/qemu/keymaps.c	2010-04-15 07:59:13.000000000 +0200
-@@ -38,13 +38,26 @@
-     struct key_range *next;
- };
- 
-+#define KEYMOD_SHIFT 0x01
-+#define KEYMOD_CTRL  0x02
-+#define KEYMOD_ALT   0x04
-+#define KEYMOD_DEAD  0x08
-+#define KEYMOD_ALTGR 0x10
-+
- #define MAX_NORMAL_KEYCODE 512
- #define MAX_EXTRA_COUNT 256
-+
-+typedef struct {
-+    uint16_t keycode;
-+    uint8_t keymod;
-+    int deadsym;
-+} keydata_t;
-+
- typedef struct {
--    uint16_t keysym2keycode[MAX_NORMAL_KEYCODE];
-+    keydata_t keysym2keycode[MAX_NORMAL_KEYCODE];
-     struct {
- 	int keysym;
--	uint16_t keycode;
-+        keydata_t kdata;
-     } keysym2keycode_extra[MAX_EXTRA_COUNT];
-     int extra_count;
-     struct key_range *keypad_range;
-@@ -82,6 +95,7 @@
-     char file_name[1024];
-     char line[1024];
-     int len;
-+    int upper;
- 
-     snprintf(file_name, sizeof(file_name),
-              "%s/keymaps/%s", bios_dir, language);
-@@ -114,25 +128,68 @@
- 	    if (*end_of_keysym) {
- 		int keysym;
- 		*end_of_keysym = 0;
-+                uint8_t keymod;
-+                int deadsym;
-+                
-+                keymod = 0;
-+                deadsym = 0;
-+		upper = 0;
-+redo:
-+                if (upper==1){
-+                    char *c;
-+                    for(c=line;*c;c++)
-+                        *c=toupper(*c);
-+                    keymod |= KEYMOD_SHIFT;
-+                    upper++;
-+                }
-+
-+
- 		keysym = get_keysym(line);
- 		if (keysym == 0) {
-                     //		    fprintf(stderr, "Warning: unknown keysym %s\n", line);
- 		} else {
- 		    const char *rest = end_of_keysym + 1;
- 		    char *rest2;
-+		    char *modifier;
- 		    int keycode = strtol(rest, &rest2, 0);
- 
--		    if (rest && strstr(rest, "numlock")) {
--			add_to_key_range(&k->keypad_range, keycode);
--			add_to_key_range(&k->numlock_range, keysym);
--			//fprintf(stderr, "keypad keysym %04x keycode %d\n", keysym, keycode);
-+                    modifier = strtok (rest2, " ");
-+                    while (modifier != NULL) {
-+                        if (!strcmp(modifier, "shift")) {
-+                            keymod |= KEYMOD_SHIFT;
-+                        } else
-+			if (!strcmp(modifier, "addupper")) {
-+			    upper++;
-+			} else 
-+                        if (!strcmp(modifier, "ctrl")) {
-+                            keymod |= KEYMOD_CTRL;
-+                        } else
-+                        if (!strcmp(modifier, "alt")) {
-+                            keymod |= KEYMOD_ALT;
-+                        } else
-+                        if (!strcmp(modifier, "altgr")) {
-+                            keymod |= KEYMOD_ALTGR;
-+                        } else
-+                        if (!strncmp(modifier, "dead_",5)) {
-+                            keymod |= KEYMOD_DEAD;
-+                            deadsym = get_keysym(modifier);
-+                        } else
-+                        if (!strcmp(modifier, "numlock")) {
-+			    add_to_key_range(&k->keypad_range, keycode);
-+			    add_to_key_range(&k->numlock_range, keysym);
-+			    //fprintf(stderr, "keypad keysym %04x keycode %d\n", keysym, keycode);
-+			}
-+			modifier = strtok (NULL," ");
- 		    }
- 
- 		    /* if(keycode&0x80)
- 		       keycode=(keycode<<8)^0x80e0; */
- 		    if (keysym < MAX_NORMAL_KEYCODE) {
- 			//fprintf(stderr,"Setting keysym %s (%d) to %d\n",line,keysym,keycode);
--			k->keysym2keycode[keysym] = keycode;
-+                        k->keysym2keycode[keysym].keycode = keycode;
-+                        k->keysym2keycode[keysym].keymod = keymod;
-+                        k->keysym2keycode[keysym].deadsym = deadsym;
-+
- 		    } else {
- 			if (k->extra_count >= MAX_EXTRA_COUNT) {
- 			    fprintf(stderr,
-@@ -145,11 +202,18 @@
- #endif
- 			    k->keysym2keycode_extra[k->extra_count].
- 				keysym = keysym;
--			    k->keysym2keycode_extra[k->extra_count].
--				keycode = keycode;
-+			    k->keysym2keycode_extra[k->extra_count].kdata.
-+			        keycode = keycode;
-+			    k->keysym2keycode_extra[k->extra_count].kdata.
-+			        keymod = keymod;
-+                            k->keysym2keycode_extra[k->extra_count].kdata.
-+			        deadsym = deadsym;
-+
- 			    k->extra_count++;
- 			}
- 		    }
-+                    if (upper==1)
-+			    goto redo;
- 		}
- 	    }
- 	}
-@@ -163,14 +227,11 @@
-     return parse_keyboard_layout(language, 0);
- }
- 
--static int keysym2scancode(void *kbd_layout, int keysym)
-+static keydata_t *find_keysym(void *kbd_layout, int keysym)
- {
-     kbd_layout_t *k = kbd_layout;
-     if (keysym < MAX_NORMAL_KEYCODE) {
--	if (k->keysym2keycode[keysym] == 0)
--	    fprintf(stderr, "Warning: no scancode found for keysym %d\n",
--		    keysym);
--	return k->keysym2keycode[keysym];
-+	return &k->keysym2keycode[keysym];
-     } else {
- 	int i;
- #ifdef XK_ISO_Left_Tab
-@@ -178,10 +239,10 @@
- 	    keysym = XK_Tab;
- #endif
- 	for (i = 0; i < k->extra_count; i++)
--	    if (k->keysym2keycode_extra[i].keysym == keysym)
--		return k->keysym2keycode_extra[i].keycode;
-+            if (k->keysym2keycode_extra[i].keysym == keysym)
-+                return &k->keysym2keycode_extra[i].kdata;
+--- kvm-src.orig/qemu/vnc.c	2011-03-15 07:31:58.000000000 +0100
++++ kvm-src/qemu/vnc.c	2011-03-15 07:31:58.000000000 +0100
+@@ -1152,8 +1152,22 @@
      }
--    return 0;
-+    return NULL;
  }
  
- static inline int keycode_is_keypad(void *kbd_layout, int keycode)
-Index: kvm-test/qemu/curses.c
-===================================================================
---- kvm-test.orig/qemu/curses.c	2009-01-20 11:03:25.000000000 +0100
-+++ kvm-test/qemu/curses.c	2010-04-15 07:59:13.000000000 +0200
-@@ -238,7 +238,11 @@
-                 keysym = chr;
- 
-             keycode &= ~KEY_MASK;
--            keycode |= keysym2scancode(kbd_layout, keysym);
++#define SCANCODE_KEYMASK 0xff
++#define SCANCODE_KEYCODEMASK 0x7f
++#define SCANCODE_GREY   0x80
++#define SCANCODE_EMUL0  0xE0
++#define SCANCODE_UP     0x80
++#define SCANCODE_SHIFT  0x100
++#define SCANCODE_CTRL   0x200
++#define SCANCODE_ALT    0x400
++#define SCANCODE_ALTGR  0x800
 +
-+	    keydata_t *kd = find_keysym(kbd_layout, keysym);
-+	    if (kd) {
-+		keycode |= kd->keycode;
-+	    }
-         }
- 
-         if (is_graphic_console()) {
-Index: kvm-test/qemu/sdl.c
-===================================================================
---- kvm-test.orig/qemu/sdl.c	2009-01-20 11:03:25.000000000 +0100
-+++ kvm-test/qemu/sdl.c	2010-04-15 07:59:13.000000000 +0200
-@@ -127,7 +127,11 @@
-     if (keysym == 92 && ev->keysym.scancode == 133) {
-         keysym = 0xa5;
-     }
--    return keysym2scancode(kbd_layout, keysym);
-+    keydata_t *kd = find_keysym(kbd_layout, keysym);
-+    if (kd==NULL)
-+        return 0;
-+    else
-+        return kd->keycode;
- }
- 
- /* specific keyboard conversions from scan codes */
-Index: kvm-test/qemu/vnc.c
-===================================================================
---- kvm-test.orig/qemu/vnc.c	2010-04-15 07:58:52.000000000 +0200
-+++ kvm-test/qemu/vnc.c	2010-04-15 08:04:27.000000000 +0200
-@@ -56,6 +56,20 @@
- #define VNC_DEBUG(fmt, ...) do { } while (0)
- #endif
- 
-+typedef struct {
-+    int keycode;
-+    int bit;
-+} modifier_t;
-+
-+static modifier_t test_modifier[]={
-+    {0x2a, KEYMOD_SHIFT},
-+    {0x36, KEYMOD_SHIFT},
-+    {0x1d, KEYMOD_CTRL},
-+    {0x9d, KEYMOD_CTRL},
-+    {0x38, KEYMOD_ALT},
-+    {0xb8, KEYMOD_ALTGR},
-+    {0,0},
-+};
- 
- typedef struct Buffer
+ static void do_key_event(VncState *vs, int down, int keycode, int sym)
  {
-@@ -189,7 +203,7 @@
-     VncReadEvent *read_handler;
-     size_t read_handler_expect;
-     /* input */
--    uint8_t modifiers_state[256];
-+    uint8_t modifiers_state[2][256];
- 
-     VncState *next;
- };
-@@ -1107,27 +1121,85 @@
-     check_pointer_type_change(vs, kbd_mouse_is_absolute());
- }
- 
-+static void do_keycode(int keycode, int down)
-+{
-+    // fprintf (stderr, "KEY: %04x %d\n", keycode, down);
-+    if (keycode & 0x80)
-+        kbd_put_keycode(0xe0);
-+    if (down)
-+        kbd_put_keycode(keycode & 0x7f);
-+    else
-+        kbd_put_keycode(keycode | 0x80);
-+}
++    int mods =  keycode & 0xf00;
 +
-+static void do_modifier(VncState *vs, int keycode, int down, int level)
-+{
-+    do_keycode(keycode, down);
-+    vs->modifiers_state[level][keycode] = down;
-+    if (level==0) {
-+        vs->modifiers_state[1][keycode] = down;
-+    }
-+}
++    keycode &= SCANCODE_KEYMASK;
 +
- static void reset_keys(VncState *vs)
- {
-     int i;
-     for(i = 0; i < 256; i++) {
--        if (vs->modifiers_state[i]) {
--            if (i & 0x80)
--                kbd_put_keycode(0xe0);
--            kbd_put_keycode(i | 0x80);
--            vs->modifiers_state[i] = 0;
-+        if (vs->modifiers_state[0][i]) {
-+           do_modifier (vs, i, 0, 0);
-         }
-     }
- }
- 
-+static void set_modifiers(VncState *vs, uint8_t reqstate, int down, int full)
-+{
-+    modifier_t *m;
-+    for(m=test_modifier; m->bit; m++) {
-+        int requested = reqstate & m->bit;
-+        /* Release unwanted modifiers */
-+        if (!down || full) {
-+            if (vs->modifiers_state[1][m->keycode] && !requested)
-+                do_modifier(vs, m->keycode, 0, 1);
-+        }
-+        /* Press desired modifiers */
-+        if (down || full) {
-+            int already_set = vs->modifiers_state[1][m->keycode];
-+            if (!already_set && requested)
-+                do_modifier(vs, m->keycode, 1, 1);
-+        }
-+    }
-+}
-+
-+static void restore_modifiers(VncState *vs)
-+{
-+    /* Restore modifiers from reference */
-+    modifier_t *m;
-+    for(m=test_modifier; m->bit; m++) {
-+        if (vs->modifiers_state[0][m->keycode] !=
-+           vs->modifiers_state[1][m->keycode])
-+            do_modifier(vs, m->keycode, vs->modifiers_state[0][m->keycode], 0);
-+    }
-+}
-+
- static void press_key(VncState *vs, int keysym)
- {
--    kbd_put_keycode(keysym2scancode(vs->vd->kbd_layout, keysym) & 0x7f);
--    kbd_put_keycode(keysym2scancode(vs->vd->kbd_layout, keysym) | 0x80);
-+    keydata_t *kd = find_keysym(vs->vd->kbd_layout, keysym & 0xFFFF);
-+    if (kd==NULL)
-+        return;
-+
-+    kbd_put_keycode(kd->keycode & 0x7f);
-+    kbd_put_keycode(kd->keycode | 0x80);
- }
- 
--static void do_key_event(VncState *vs, int down, int keycode, int sym)
-+static void do_key_event(VncState *vs, int down, keydata_t *kd, int sym)
- {
-+    if (kd==NULL)
-+        return;
-+
-+    int keycode = kd->keycode;
-+    //fprintf (stderr, "SYM: %04x SCANCODE: %04x MOD %04x\n",
-+    //      sym, keycode, kd->keymod);
-+
      /* QEMU console switch */
      switch(keycode) {
      case 0x2a:                          /* Left Shift */
-@@ -1136,24 +1208,25 @@
-     case 0x9d:                          /* Right CTRL */
-     case 0x38:                          /* Left ALT */
-     case 0xb8:                          /* Right ALT */
--        if (down)
--            vs->modifiers_state[keycode] = 1;
--        else
--            vs->modifiers_state[keycode] = 0;
--        break;
-+        do_modifier(vs, keycode, down, 0);
-+        return;
-     case 0x02 ... 0x0a: /* '1' to '9' keys */
--        if (down && vs->modifiers_state[0x1d] && vs->modifiers_state[0x38]) {
-+        if (down && vs->modifiers_state[0][0x1d] && vs->modifiers_state[0][0x38]) {
-             /* Reset the modifiers sent to the current console */
-             reset_keys(vs);
-             console_select(keycode - 0x02);
-             return;
-         }
-         break;
--    case 0x3a:			/* CapsLock */
--    case 0x45:			/* NumLock */
--        if (!down)
--            vs->modifiers_state[keycode] ^= 1;
--        break;
-+    case 0x3a:                 /* CapsLock */
-+    case 0x45:                 /* NumLock */
-+        if (!down) {
-+           if (vs->modifiers_state[0][0x45])
-+               do_modifier(vs, keycode, 0, 0);
-+           else
-+               do_modifier(vs, keycode, 1, 0);
-+       }
-+       break;
+@@ -1222,12 +1236,42 @@
      }
  
-     if (keycode_is_keypad(vs->vd->kbd_layout, keycode)) {
-@@ -1162,13 +1235,13 @@
-            toggles numlock away from the VNC window.
-         */
-         if (keysym_is_numlock(vs->vd->kbd_layout, sym & 0xFFFF)) {
--            if (!vs->modifiers_state[0x45]) {
--                vs->modifiers_state[0x45] = 1;
--                press_key(vs, 0xff7f);
--            }
-+ 	    if (!vs->modifiers_state[0][0x45]) {
-+ 		do_modifier(vs, 0x45, 1, 0);
-+ 		press_key(vs, 0xff7f);
-+ 	    }
-         } else {
--            if (vs->modifiers_state[0x45]) {
--                vs->modifiers_state[0x45] = 0;
-+             if (vs->modifiers_state[0][0x45]) {
-+                do_modifier(vs, 0x45, 0, 0);
-                 press_key(vs, 0xff7f);
-             }
-         }
-@@ -1180,28 +1253,45 @@
-            toggles capslock away from the VNC window.
-         */
-         int uppercase = !!(sym >= 'A' && sym <= 'Z');
--        int shift = !!(vs->modifiers_state[0x2a] | vs->modifiers_state[0x36]);
--        int capslock = !!(vs->modifiers_state[0x3a]);
-+        int shift = !!(vs->modifiers_state[0][0x2a] | vs->modifiers_state[0][0x36]);
-+        int capslock = !!(vs->modifiers_state[0][0x3a]);
-         if (capslock) {
-             if (uppercase == shift) {
--                vs->modifiers_state[0x3a] = 0;
-+                do_modifier(vs, 0x3a, 0, 0);
-                 press_key(vs, 0xffe5);
-             }
-         } else {
-             if (uppercase != shift) {
--                vs->modifiers_state[0x3a] = 1;
-+                do_modifier(vs, 0x3a, 1, 0);
-                 press_key(vs, 0xffe5);
-             }
-         }
-     }
- 
      if (is_graphic_console()) {
 -        if (keycode & 0x80)
--            kbd_put_keycode(0xe0);
--        if (down)
--            kbd_put_keycode(keycode & 0x7f);
--        else
--            kbd_put_keycode(keycode | 0x80);
-+         if (down) {
-+            /* Send deadkey */
-+            if (kd->keymod & KEYMOD_DEAD) {
-+              keydata_t *deaddata;
-+              deaddata = find_keysym(vs->vd->kbd_layout, kd->deadsym);
-+              if (deaddata != NULL) {
-+                 set_modifiers(vs, deaddata->keymod, 0, 1);
-+                 do_keycode(deaddata->keycode, 1);
-+                 do_keycode(deaddata->keycode, 0);
-+                 restore_modifiers(vs);
-+              }
-+            }
-+            set_modifiers(vs, kd->keymod, 1, 0);
-+        } else
-+            restore_modifiers(vs);
 +
-+         do_keycode (keycode, down);
++  	/* our java vnc client never sends ALTGR, so we create
++ 	   an artificial up/down event */
 +
-+        /* vnc never sends ALTGR, so we create an artificial up event */
-+        if (down && (kd->keymod & KEYMOD_ALTGR)) {
-+            set_modifiers(vs, kd->keymod, 0, 0);
-+        }
++ 	int emul_altgr = (mods & SCANCODE_ALTGR) &&
++ 	    !vs->modifiers_state[0xb8];
 +
++ 	if (emul_altgr) {
++ 		reset_keys(vs);
++ 		kbd_put_keycode(SCANCODE_EMUL0);
++ 		kbd_put_keycode(0xb8 & SCANCODE_KEYCODEMASK);
++ 	}
++
++ 	int emul_shift = (mods & SCANCODE_SHIFT) &&
++ 	    !vs->modifiers_state[0x2a];
++
++ 	if (emul_shift) {
++ 	    kbd_put_keycode(0x2a & SCANCODE_KEYCODEMASK);
++ 	}
++
++       if (keycode & 0x80)
+             kbd_put_keycode(0xe0);
+         if (down)
+             kbd_put_keycode(keycode & 0x7f);
+         else
+             kbd_put_keycode(keycode | 0x80);
++
++ 	if (emul_shift) {
++ 	    kbd_put_keycode(0x2a | SCANCODE_UP);
++ 	}
++
++ 	if (emul_altgr) {
++ 	    kbd_put_keycode(SCANCODE_EMUL0);
++ 	    kbd_put_keycode(0xb8 | SCANCODE_UP);
++ 	}
++
      } else {
          /* QEMU console emulation */
          if (down) {
-@@ -1302,15 +1392,9 @@
- 
- static void key_event(VncState *vs, int down, uint32_t sym)
- {
--    int keycode;
--    int lsym = sym;
-+     keydata_t *kd = find_keysym(vs->vd->kbd_layout, sym & 0xFFFF);
- 
--    if (lsym >= 'A' && lsym <= 'Z' && is_graphic_console()) {
--        lsym = lsym - 'A' + 'a';
--    }
--
--    keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF);
--    do_key_event(vs, down, keycode, sym);
-+     do_key_event(vs, down, kd, sym & 0xFFFF);
- }
- 
- static void ext_key_event(VncState *vs, int down,
-@@ -1319,8 +1403,15 @@
-     /* if the user specifies a keyboard layout, always use it */
-     if (keyboard_layout)
-         key_event(vs, down, sym);
--    else
--        do_key_event(vs, down, keycode, sym);
-+    else {
-+	keydata_t kd;
-+
-+        kd.keycode = keycode;
-+	kd.keymod = 0;
-+	kd.deadsym = 0;
-+
-+	do_key_event(vs, down, &kd, sym & 0xFFFF);
-+    }
- }
- 
- static void framebuffer_update_request(VncState *vs, int incremental,
-@@ -1441,7 +1532,7 @@
+@@ -1467,7 +1511,7 @@
          vs->send_hextile_tile = send_hextile_tile_32;
      } else
      if (bits_per_pixel == 16 &&
@@ -485,7 +78,7 @@
          host_big_endian_flag == big_endian_flag &&
          red_max == 31 && green_max == 63 && blue_max == 31 &&
          red_shift == 11 && green_shift == 5 && blue_shift == 0) {
-@@ -1560,8 +1651,8 @@
+@@ -1586,8 +1630,8 @@
      host_big_endian_flag = 1;
  #else
      host_big_endian_flag = 0;
@@ -496,3 +89,32 @@
      switch (depth) {
          case 8:
              vs->depth = depth / 8;
+Index: kvm-src/qemu/keymaps.c
+===================================================================
+--- kvm-src.orig/qemu/keymaps.c	2011-03-15 07:52:13.000000000 +0100
++++ kvm-src/qemu/keymaps.c	2011-03-15 07:54:41.000000000 +0100
+@@ -75,6 +75,10 @@
+     }
+ }
+ 
++#define SCANCODE_SHIFT  0x100
++#define SCANCODE_CTRL   0x200
++#define SCANCODE_ALTGR  0x800
++
+ static kbd_layout_t *parse_keyboard_layout(const char *language,
+ 					   kbd_layout_t * k)
+ {
+@@ -128,6 +132,13 @@
+ 			//fprintf(stderr, "keypad keysym %04x keycode %d\n", keysym, keycode);
+ 		    }
+ 
++		    if (rest && strstr(rest, "shift"))
++			keycode |= SCANCODE_SHIFT;
++		    if (rest && strstr(rest, "altgr"))
++			keycode |= SCANCODE_ALTGR;
++		    if (rest && strstr(rest, "ctrl"))
++			keycode |= SCANCODE_CTRL;
++
+ 		    /* if(keycode&0x80)
+ 		       keycode=(keycode<<8)^0x80e0; */
+ 		    if (keysym < MAX_NORMAL_KEYCODE) {

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/kvm-vma-fix.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/kvm-vma-fix.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/kvm-vma-fix.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,7 +1,7 @@
 Index: kvm-src/kernel/ksm/external-module-compat.h
 ===================================================================
---- kvm-src.orig/kernel/ksm/external-module-compat.h	2009-12-04 12:02:50.000000000 +0100
-+++ kvm-src/kernel/ksm/external-module-compat.h	2009-12-04 12:02:58.000000000 +0100
+--- kvm-src.orig/kernel/ksm/external-module-compat.h	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/kernel/ksm/external-module-compat.h	2011-03-15 07:30:51.000000000 +0100
 @@ -35,7 +35,7 @@
  #define list_first_entry(ptr, type, member) \
          list_entry((ptr)->next, type, member)

Modified: pve-kernel-2.6.18/trunk/kvmdeb/patches/vncticket.diff
===================================================================
--- pve-kernel-2.6.18/trunk/kvmdeb/patches/vncticket.diff	2011-03-15 05:57:41 UTC (rev 5703)
+++ pve-kernel-2.6.18/trunk/kvmdeb/patches/vncticket.diff	2011-03-15 07:30:05 UTC (rev 5704)
@@ -1,8 +1,8 @@
-Index: kvm-test/qemu/console.h
+Index: kvm-src/qemu/console.h
 ===================================================================
---- kvm-test.orig/qemu/console.h	2010-04-15 07:57:43.000000000 +0200
-+++ kvm-test/qemu/console.h	2010-04-15 07:58:52.000000000 +0200
-@@ -179,7 +179,7 @@
+--- kvm-src.orig/qemu/console.h	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/console.h	2011-03-15 07:30:41.000000000 +0100
+@@ -194,7 +194,7 @@
  void vnc_display_init(DisplayState *ds);
  void vnc_display_close(DisplayState *ds);
  int vnc_display_open(DisplayState *ds, const char *display);
@@ -11,11 +11,11 @@
  void do_info_vnc(void);
  
  /* curses.c */
-Index: kvm-test/qemu/monitor.c
+Index: kvm-src/qemu/monitor.c
 ===================================================================
---- kvm-test.orig/qemu/monitor.c	2010-04-15 07:57:44.000000000 +0200
-+++ kvm-test/qemu/monitor.c	2010-04-15 07:58:52.000000000 +0200
-@@ -556,14 +556,15 @@
+--- kvm-src.orig/qemu/monitor.c	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/monitor.c	2011-03-15 07:30:41.000000000 +0100
+@@ -559,14 +559,15 @@
  static void do_change_vnc(const char *target, const char *arg)
  {
      if (strcmp(target, "passwd") == 0 ||
@@ -33,10 +33,10 @@
  	    term_printf("could not set VNC server password\n");
      } else {
  	if (vnc_display_open(NULL, target) < 0)
-Index: kvm-test/qemu/vnc.c
+Index: kvm-src/qemu/vnc.c
 ===================================================================
---- kvm-test.orig/qemu/vnc.c	2010-04-15 07:57:44.000000000 +0200
-+++ kvm-test/qemu/vnc.c	2010-04-15 07:58:52.000000000 +0200
+--- kvm-src.orig/qemu/vnc.c	2011-03-15 07:30:24.000000000 +0100
++++ kvm-src/qemu/vnc.c	2011-03-15 07:30:41.000000000 +0100
 @@ -128,6 +128,7 @@
  
      char *display;
@@ -45,7 +45,7 @@
      int auth;
  #ifdef CONFIG_VNC_TLS
      int subauth;
-@@ -1823,7 +1824,10 @@
+@@ -1861,7 +1862,10 @@
      char key[8];
      gcry_error_t e;
  
@@ -57,7 +57,7 @@
  	VNC_DEBUG("No password configured on server");
  	vnc_write_u32(vs, 1); /* Reject auth */
  	if (vs->minor >= 8) {
-@@ -2492,6 +2496,8 @@
+@@ -2531,6 +2535,8 @@
  
      vs->lsock = -1;
  
@@ -66,7 +66,7 @@
      vs->ds = ds;
  
      if (keyboard_layout)
-@@ -2606,7 +2612,7 @@
+@@ -2645,7 +2651,7 @@
  #endif
  }
  
@@ -75,7 +75,7 @@
  {
      VncDisplay *vs = ds ? ds->opaque : vnc_display;
  
-@@ -2617,6 +2623,7 @@
+@@ -2656,6 +2662,7 @@
      if (password && password[0]) {
  	if (!(vs->password = qemu_strdup(password)))
  	    return -1;



More information about the pve-devel mailing list