All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
@ 2014-12-03  6:55 arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 1/6] vnc: introduce vnc_display_kbd_layout function arei.gonglei
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

A bonus of this feature is that supporting different
people (in different countries) using defferent keyboard
to connect the same guest but not need to configure
command line or libivrt xml file then restart guest.

Using a new QMP command:
    -> { "execute": "change-vnc-kbd-layout",
                    "arguments": { "keymap": "de" } }
    <- { "return": {}
 
I knew sdl and curses are using keyboard layout, but I don't know
whether they both need to support this feature and add some new
qmp command for them?

If you have some ideas, please let me know. Thanks!

NOTE:
 The patch series based on Gerd's vnc-next tree:
https://www.kraxel.org/cgit/qemu/log/?h=rebase/ui-vnc-next

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>

v1 -> v2:
 - introduce a new QMP command for changing keyboard layout.(Eric)
 - add corresponding HMP command in patch 3
 - fix typo about change-vnc-password in patch 4
 - formating coding style of keymaps.c patch 5
 - keymaps.c convert fprintf to qerror_report in patch 6

Gonglei (6):
  vnc: introduce vnc_display_kbd_layout function
  vnc: add a new QMP command for changing keyboard layout
  vnc: HMP change-vnc-kbd-layout wrapper
  qapi-schema: fix typo about change-vnc-password
  keymaps: correct keymaps.c following Qemu coding style
  keymaps: convert fprintf to qerror_report

 hmp-commands.hx      |  15 ++++
 hmp.c                |   9 +++
 hmp.h                |   1 +
 include/ui/console.h |   5 ++
 qapi-schema.json     |  19 ++++-
 qmp-commands.hx      |  23 ++++++
 qmp.c                |  13 ++++
 ui/keymaps.c         | 198 ++++++++++++++++++++++++++++-----------------------
 ui/vnc.c             |  21 ++++++
 9 files changed, 215 insertions(+), 89 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 1/6] vnc: introduce vnc_display_kbd_layout function
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 2/6] vnc: add a new QMP command for changing keyboard layout arei.gonglei
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

In order to support changing vnc keyboard layout dynamically.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 include/ui/console.h |  5 +++++
 ui/vnc.c             | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/include/ui/console.h b/include/ui/console.h
index 887ed91..4645dc3 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -333,6 +333,7 @@ void vnc_display_add_client(const char *id, int csock, bool skipauth);
 char *vnc_display_local_addr(const char *id);
 #ifdef CONFIG_VNC
 int vnc_display_password(const char *id, const char *password);
+int vnc_display_kbd_layout(const char *id, const char *kbd_layout);
 int vnc_display_pw_expire(const char *id, time_t expires);
 QemuOpts *vnc_parse_func(const char *str);
 int vnc_init_func(QemuOpts *opts, void *opaque);
@@ -341,6 +342,10 @@ static inline int vnc_display_password(const char *id, const char *password)
 {
     return -ENODEV;
 }
+int vnc_display_kbd_layout(const char *id, const char *kbd_layout)
+{
+    return -ENODEV;
+}
 static inline int vnc_display_pw_expire(const char *id, time_t expires)
 {
     return -ENODEV;
diff --git a/ui/vnc.c b/ui/vnc.c
index 8d189e7..35aad70 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3090,6 +3090,27 @@ int vnc_display_password(const char *id, const char *password)
     return 0;
 }
 
+int vnc_display_kbd_layout(const char *id, const char *kbd_layout)
+{
+    VncDisplay *vs = vnc_display_find(id);
+    kbd_layout_t *k = NULL;
+
+    if (!vs) {
+        return -EINVAL;
+    }
+
+    k = init_keyboard_layout(name2keysym, kbd_layout);
+    if (!k) {
+        return -EINVAL;
+    }
+
+    trace_vnc_key_map_init(kbd_layout);
+    g_free(vs->kbd_layout);
+    vs->kbd_layout = k;
+
+    return 0;
+}
+
 int vnc_display_pw_expire(const char *id, time_t expires)
 {
     VncDisplay *vs = vnc_display_find(id);
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 2/6] vnc: add a new QMP command for changing keyboard layout
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 1/6] vnc: introduce vnc_display_kbd_layout function arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 3/6] vnc: HMP change-vnc-kbd-layout wrapper arei.gonglei
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

Example QMP command of Change VNC keyboard layout:
-> { "execute": "change-vnc-kbd-layout",
                "arguments": { "keymap": "de" } }
<- { "return": {}

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 qapi-schema.json | 17 +++++++++++++++++
 qmp-commands.hx  | 23 +++++++++++++++++++++++
 qmp.c            | 13 +++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/qapi-schema.json b/qapi-schema.json
index 9ffdcf8..0d89b63 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1543,6 +1543,23 @@
 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
 
 ##
+# @change-vnc-kbd-layout:
+#
+# Change the VNC server keyboard layout.
+#
+# @keymap:  the new VNC keyboard layout to set.
+#
+# Returns: Nothing on success
+#          If VNC is not active, DeviceNotFound.
+#
+# Since: 2.3
+#
+# Notes:  Nothing will be changed on failure.
+#
+##
+{ 'command': 'change-vnc-kbd-layout', 'data': {'keymap': 'str'} }
+
+##
 # @change:
 #
 # This command is multiple commands multiplexed together.
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 718dd92..54fe230 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3854,3 +3854,26 @@ Move mouse pointer to absolute coordinates (20000, 400).
 <- { "return": {} }
 
 EQMP
+
+    {
+        .name       = "change-vnc-kbd-layout",
+        .args_type  = "keymap:s",
+        .mhandler.cmd_new = qmp_marshal_input_change_vnc_kbd_layout,
+    },
+
+SQMP
+change-vnc-kbd-layout
+---------------------
+
+Change VNC keyboard layout.
+
+Arguments:
+
+- "keymap": the new VNC keyboard layout to set.
+
+Example:
+
+-> { "execute": "change-vnc-kbd-layout", "arguments": { "keymap": "de" } }
+<- { "return": {} }
+
+EQMP
diff --git a/qmp.c b/qmp.c
index 3fda973..812ded7 100644
--- a/qmp.c
+++ b/qmp.c
@@ -366,6 +366,13 @@ void qmp_change_vnc_password(const char *password, Error **errp)
     }
 }
 
+void qmp_change_vnc_kbd_layout(const char *keymap, Error **errp)
+{
+    if (vnc_display_kbd_layout(NULL, keymap) < 0) {
+        error_setg(errp, "keyboard layout '%s' set failed", keymap);
+    }
+}
+
 static void qmp_change_vnc_listen(const char *target, Error **errp)
 {
     QemuOptsList *olist = qemu_find_opts("vnc");
@@ -402,6 +409,12 @@ void qmp_change_vnc_password(const char *password, Error **errp)
 {
     error_set(errp, QERR_FEATURE_DISABLED, "vnc");
 }
+
+void qmp_change_vnc_kbd_layout(const char *keymap, Error **errp)
+{
+    error_set(errp, QERR_FEATURE_DISABLED, "vnc");
+}
+
 static void qmp_change_vnc(const char *target, bool has_arg, const char *arg,
                            Error **errp)
 {
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 3/6] vnc: HMP change-vnc-kbd-layout wrapper
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 1/6] vnc: introduce vnc_display_kbd_layout function arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 2/6] vnc: add a new QMP command for changing keyboard layout arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 4/6] qapi-schema: fix typo about change-vnc-password arei.gonglei
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

Add HMP change-vnc-kbd-layout wrapper to allow changing
VNC server keyboard layout via monitor.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hmp-commands.hx | 15 +++++++++++++++
 hmp.c           |  9 +++++++++
 hmp.h           |  1 +
 3 files changed, 25 insertions(+)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index e37bc8b..596e0ff 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1627,6 +1627,21 @@ passed since 1970, i.e. unix epoch.
 ETEXI
 
     {
+        .name       = "change-vnc-kbd-layout",
+        .args_type  = "keymap:s",
+        .params     = "keymap",
+        .help       = "change VNC keyboard layout",
+        .mhandler.cmd = hmp_change_vnc_kbd_layout,
+    },
+
+STEXI
+@item change-vnc-kbd-layout @var{keymap}
+@findex change-vnc-kbd-layout
+Change VNC keyboard layout to @var{keymap}
+
+ETEXI
+
+    {
         .name       = "chardev-add",
         .args_type  = "args:s",
         .params     = "args",
diff --git a/hmp.c b/hmp.c
index 63d7686..8d43cbe 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1758,3 +1758,12 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
 
     qapi_free_MemoryDeviceInfoList(info_list);
 }
+
+void hmp_change_vnc_kbd_layout(Monitor *mon, const QDict *qdict)
+{
+    Error *local_err = NULL;
+    const char *keymap = qdict_get_str(qdict, "keymap");
+
+    qmp_change_vnc_kbd_layout(keymap, &local_err);
+    hmp_handle_error(mon, &local_err);
+}
diff --git a/hmp.h b/hmp.h
index 4bb5dca..2bc1b27 100644
--- a/hmp.h
+++ b/hmp.h
@@ -116,5 +116,6 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args,
                                 const char *str);
 void delvm_completion(ReadLineState *rs, int nb_args, const char *str);
 void loadvm_completion(ReadLineState *rs, int nb_args, const char *str);
+void hmp_change_vnc_kbd_layout(Monitor *mon, const QDict *qdict);
 
 #endif
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 4/6] qapi-schema: fix typo about change-vnc-password
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
                   ` (2 preceding siblings ...)
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 3/6] vnc: HMP change-vnc-kbd-layout wrapper arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 5/6] keymaps: correct keymaps.c following Qemu coding style arei.gonglei
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 qapi-schema.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 0d89b63..ae68a25 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1533,7 +1533,7 @@
 #
 # Change the VNC server password.
 #
-# @target:  the new password to use with VNC authentication
+# @password:  the new password to use with VNC authentication
 #
 # Since: 1.1
 #
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 5/6] keymaps: correct keymaps.c following Qemu coding style
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
                   ` (3 preceding siblings ...)
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 4/6] qapi-schema: fix typo about change-vnc-password arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 6/6] keymaps: convert fprintf to qerror_report arei.gonglei
  2014-12-03  9:38 ` [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically Daniel P. Berrange
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

It's hard to read because of the confused coding
style in this file. Let's correct it following Qemu
coding style.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 ui/keymaps.c | 196 ++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 108 insertions(+), 88 deletions(-)

diff --git a/ui/keymaps.c b/ui/keymaps.c
index 80d658d..49410ae 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -26,18 +26,20 @@
 #include "sysemu/sysemu.h"
 
 static int get_keysym(const name2keysym_t *table,
-		      const char *name)
+                      const char *name)
 {
     const name2keysym_t *p;
     for(p = table; p->name != NULL; p++) {
-        if (!strcmp(p->name, name))
+        if (!strcmp(p->name, name)) {
             return p->keysym;
+        }
     }
     if (name[0] == 'U' && strlen(name) == 5) { /* try unicode Uxxxx */
         char *end;
         int ret = (int)strtoul(name + 1, &end, 16);
-        if (*end == '\0' && ret > 0)
-          return ret;
+        if (*end == '\0' && ret > 0) {
+            return ret;
+        }
     }
     return 0;
 }
@@ -46,19 +48,20 @@ static int get_keysym(const name2keysym_t *table,
 static void add_to_key_range(struct key_range **krp, int code) {
     struct key_range *kr;
     for (kr = *krp; kr; kr = kr->next) {
-	if (code >= kr->start && code <= kr->end)
-	    break;
-	if (code == kr->start - 1) {
-	    kr->start--;
-	    break;
-	}
-	if (code == kr->end + 1) {
-	    kr->end++;
-	    break;
-	}
+        if (code >= kr->start && code <= kr->end) {
+            break;
+        }
+        if (code == kr->start - 1) {
+            kr->start--;
+            break;
+        }
+        if (code == kr->end + 1) {
+            kr->end++;
+            break;
+        }
     }
     if (kr == NULL) {
-	kr = g_malloc0(sizeof(*kr));
+        kr = g_malloc0(sizeof(*kr));
         kr->start = kr->end = code;
         kr->next = *krp;
         *krp = kr;
@@ -67,30 +70,30 @@ static void add_to_key_range(struct key_range **krp, int code) {
 
 static void add_keysym(char *line, int keysym, int keycode, kbd_layout_t *k) {
     if (keysym < MAX_NORMAL_KEYCODE) {
-	//fprintf(stderr,"Setting keysym %s (%d) to %d\n",line,keysym,keycode);
-	k->keysym2keycode[keysym] = keycode;
+        /* fprintf(stderr,"Setting keysym %s (%d) to %d\n",
+                   line, keysym, keycode); */
+        k->keysym2keycode[keysym] = keycode;
     } else {
-	if (k->extra_count >= MAX_EXTRA_COUNT) {
-	    fprintf(stderr,
-		    "Warning: Could not assign keysym %s (0x%x) because of memory constraints.\n",
-		    line, keysym);
-	} else {
+        if (k->extra_count >= MAX_EXTRA_COUNT) {
+            fprintf(stderr, "Warning: Could not assign keysym %s (0x%x)"
+                    " because of memory constraints.\n", line, keysym);
+        } else {
 #if 0
-	    fprintf(stderr, "Setting %d: %d,%d\n",
-		    k->extra_count, keysym, keycode);
+            fprintf(stderr, "Setting %d: %d,%d\n",
+                    k->extra_count, keysym, keycode);
 #endif
-	    k->keysym2keycode_extra[k->extra_count].
-		keysym = keysym;
-	    k->keysym2keycode_extra[k->extra_count].
-		keycode = keycode;
-	    k->extra_count++;
-	}
+            k->keysym2keycode_extra[k->extra_count].
+            keysym = keysym;
+            k->keysym2keycode_extra[k->extra_count].
+            keycode = keycode;
+            k->extra_count++;
+        }
     }
 }
 
 static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
-					   const char *language,
-					   kbd_layout_t * k)
+                                           const char *language,
+                                           kbd_layout_t *k)
 {
     FILE *f;
     char * filename;
@@ -101,69 +104,78 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
     f = filename ? fopen(filename, "r") : NULL;
     g_free(filename);
     if (!f) {
-	fprintf(stderr,
-		"Could not read keymap file: '%s'\n", language);
-	return NULL;
+        fprintf(stderr, "Could not read keymap file: '%s'\n", language);
+        return NULL;
     }
 
-    if (!k)
-	k = g_malloc0(sizeof(kbd_layout_t));
+    if (!k) {
+        k = g_malloc0(sizeof(kbd_layout_t));
+    }
 
     for(;;) {
-	if (fgets(line, 1024, f) == NULL)
+        if (fgets(line, 1024, f) == NULL) {
             break;
+        }
         len = strlen(line);
-        if (len > 0 && line[len - 1] == '\n')
+        if (len > 0 && line[len - 1] == '\n') {
             line[len - 1] = '\0';
-        if (line[0] == '#')
-	    continue;
-	if (!strncmp(line, "map ", 4))
-	    continue;
-	if (!strncmp(line, "include ", 8)) {
-	    parse_keyboard_layout(table, line + 8, k);
+        }
+        if (line[0] == '#') {
+            continue;
+        }
+        if (!strncmp(line, "map ", 4)) {
+            continue;
+        }
+        if (!strncmp(line, "include ", 8)) {
+            parse_keyboard_layout(table, line + 8, k);
         } else {
-	    char *end_of_keysym = line;
-	    while (*end_of_keysym != 0 && *end_of_keysym != ' ')
-		end_of_keysym++;
-	    if (*end_of_keysym) {
-		int keysym;
-		*end_of_keysym = 0;
-		keysym = get_keysym(table, line);
-		if (keysym == 0) {
-                    //		    fprintf(stderr, "Warning: unknown keysym %s\n", line);
-		} else {
-		    const char *rest = end_of_keysym + 1;
+            char *end_of_keysym = line;
+            while (*end_of_keysym != 0 && *end_of_keysym != ' ') {
+                end_of_keysym++;
+            }
+            if (*end_of_keysym) {
+                int keysym;
+                *end_of_keysym = 0;
+                keysym = get_keysym(table, line);
+                if (keysym == 0) {
+                    /* fprintf(stderr, "Warning: unknown keysym %s\n", line);*/
+                } else {
+                    const char *rest = end_of_keysym + 1;
                     int keycode = strtol(rest, NULL, 0);
 
                     if (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);
-		    }
+                        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); */
+                    }
 
                     if (strstr(rest, "shift")) {
-			keycode |= SCANCODE_SHIFT;
+                        keycode |= SCANCODE_SHIFT;
                     }
                     if (strstr(rest, "altgr")) {
-			keycode |= SCANCODE_ALTGR;
+                        keycode |= SCANCODE_ALTGR;
                     }
                     if (strstr(rest, "ctrl")) {
-			keycode |= SCANCODE_CTRL;
+                        keycode |= SCANCODE_CTRL;
                     }
 
-		    add_keysym(line, keysym, keycode, k);
+                    add_keysym(line, keysym, keycode, k);
 
                     if (strstr(rest, "addupper")) {
-			char *c;
-			for (c = line; *c; c++)
-			    *c = qemu_toupper(*c);
-			keysym = get_keysym(table, line);
-			if (keysym)
-			    add_keysym(line, keysym, keycode | SCANCODE_SHIFT, k);
-		    }
-		}
-	    }
-	}
+                        char *c;
+                        for (c = line; *c; c++) {
+                            *c = qemu_toupper(*c);
+                        }
+                        keysym = get_keysym(table, line);
+                        if (keysym) {
+                            add_keysym(line, keysym,
+                                       keycode | SCANCODE_SHIFT, k);
+                        }
+                    }
+                }
+            }
+        }
     }
     fclose(f);
     return k;
@@ -180,19 +192,23 @@ int keysym2scancode(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];
+        if (k->keysym2keycode[keysym] == 0) {
+            fprintf(stderr, "Warning: no scancode found for keysym %d\n",
+                    keysym);
+        }
+        return k->keysym2keycode[keysym];
     } else {
-	int i;
+        int i;
 #ifdef XK_ISO_Left_Tab
-	if (keysym == XK_ISO_Left_Tab)
-	    keysym = XK_Tab;
+        if (keysym == XK_ISO_Left_Tab) {
+            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;
+        for (i = 0; i < k->extra_count; i++) {
+            if (k->keysym2keycode_extra[i].keysym == keysym) {
+                return k->keysym2keycode_extra[i].keycode;
+            }
+        }
     }
     return 0;
 }
@@ -202,9 +218,11 @@ int keycode_is_keypad(void *kbd_layout, int keycode)
     kbd_layout_t *k = kbd_layout;
     struct key_range *kr;
 
-    for (kr = k->keypad_range; kr; kr = kr->next)
-        if (keycode >= kr->start && keycode <= kr->end)
+    for (kr = k->keypad_range; kr; kr = kr->next) {
+        if (keycode >= kr->start && keycode <= kr->end) {
             return 1;
+        }
+    }
     return 0;
 }
 
@@ -213,8 +231,10 @@ int keysym_is_numlock(void *kbd_layout, int keysym)
     kbd_layout_t *k = kbd_layout;
     struct key_range *kr;
 
-    for (kr = k->numlock_range; kr; kr = kr->next)
-        if (keysym >= kr->start && keysym <= kr->end)
+    for (kr = k->numlock_range; kr; kr = kr->next) {
+        if (keysym >= kr->start && keysym <= kr->end) {
             return 1;
+        }
+    }
     return 0;
 }
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [RFC PATCH v2 6/6] keymaps: convert fprintf to qerror_report
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
                   ` (4 preceding siblings ...)
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 5/6] keymaps: correct keymaps.c following Qemu coding style arei.gonglei
@ 2014-12-03  6:55 ` arei.gonglei
  2014-12-03  9:38 ` [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically Daniel P. Berrange
  6 siblings, 0 replies; 20+ messages in thread
From: arei.gonglei @ 2014-12-03  6:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: weidong.huang, peter.huangpeng, lcapitulino, Gonglei, kraxel

From: Gonglei <arei.gonglei@huawei.com>

Only report the first error to QMP monitor.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 ui/keymaps.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui/keymaps.c b/ui/keymaps.c
index 49410ae..47471d1 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -24,6 +24,7 @@
 
 #include "keymaps.h"
 #include "sysemu/sysemu.h"
+#include "monitor/monitor.h"
 
 static int get_keysym(const name2keysym_t *table,
                       const char *name)
@@ -104,7 +105,8 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
     f = filename ? fopen(filename, "r") : NULL;
     g_free(filename);
     if (!f) {
-        fprintf(stderr, "Could not read keymap file: '%s'\n", language);
+        qerror_report(ERROR_CLASS_GENERIC_ERROR,
+                      "Could not read keymap file: '%s'", language);
         return NULL;
     }
 
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
                   ` (5 preceding siblings ...)
  2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 6/6] keymaps: convert fprintf to qerror_report arei.gonglei
@ 2014-12-03  9:38 ` Daniel P. Berrange
  2014-12-03  9:50   ` Gonglei
  6 siblings, 1 reply; 20+ messages in thread
From: Daniel P. Berrange @ 2014-12-03  9:38 UTC (permalink / raw)
  To: arei.gonglei
  Cc: kraxel, lcapitulino, weidong.huang, qemu-devel, peter.huangpeng

On Wed, Dec 03, 2014 at 02:55:40PM +0800, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
> 
> A bonus of this feature is that supporting different
> people (in different countries) using defferent keyboard
> to connect the same guest but not need to configure
> command line or libivrt xml file then restart guest.
> 
> Using a new QMP command:
>     -> { "execute": "change-vnc-kbd-layout",
>                     "arguments": { "keymap": "de" } }
>     <- { "return": {}
>  
> I knew sdl and curses are using keyboard layout, but I don't know
> whether they both need to support this feature and add some new
> qmp command for them?
> 
> If you have some ideas, please let me know. Thanks!

FWIW users of VNC are much better off not setting any keymap at all
in QEMU, and then using a client (such as GTK-VNC) that supports the
raw scancode extension. This takes QEMU out of the key remapping
business entirely, so that everything "just works" with no extra
configuration required in QEMU. This is what SPICE does by default
too.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03  9:38 ` [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically Daniel P. Berrange
@ 2014-12-03  9:50   ` Gonglei
  2014-12-03  9:54     ` Daniel P. Berrange
  2014-12-03 12:10     ` Gerd Hoffmann
  0 siblings, 2 replies; 20+ messages in thread
From: Gonglei @ 2014-12-03  9:50 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: kraxel, lcapitulino, Huangweidong (C), qemu-devel, Huangpeng (Peter)

On 2014/12/3 17:38, Daniel P. Berrange wrote:

> On Wed, Dec 03, 2014 at 02:55:40PM +0800, arei.gonglei@huawei.com wrote:
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> A bonus of this feature is that supporting different
>> people (in different countries) using defferent keyboard
>> to connect the same guest but not need to configure
>> command line or libivrt xml file then restart guest.
>>
>> Using a new QMP command:
>>     -> { "execute": "change-vnc-kbd-layout",
>>                     "arguments": { "keymap": "de" } }
>>     <- { "return": {}
>>  
>> I knew sdl and curses are using keyboard layout, but I don't know
>> whether they both need to support this feature and add some new
>> qmp command for them?
>>
>> If you have some ideas, please let me know. Thanks!
> 
> FWIW users of VNC are much better off not setting any keymap at all
> in QEMU, and then using a client (such as GTK-VNC) that supports the
> raw scancode extension. This takes QEMU out of the key remapping
> business entirely, so that everything "just works" with no extra
> configuration required in QEMU. This is what SPICE does by default
> too.
> 

Hi, Daniel
Actually, my team had received the requirement of changing VNC keyboard
layout dynamically on the scenario of  Desktop Cloud. The clientele just use
the simplest tight vnc client, but not GTK-VNC etc. I think we should support
this scenario, isn't it ?

Regards,
-Gonglei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03  9:50   ` Gonglei
@ 2014-12-03  9:54     ` Daniel P. Berrange
  2014-12-03 10:04       ` Gonglei
  2014-12-03 12:10     ` Gerd Hoffmann
  1 sibling, 1 reply; 20+ messages in thread
From: Daniel P. Berrange @ 2014-12-03  9:54 UTC (permalink / raw)
  To: Gonglei
  Cc: kraxel, lcapitulino, Huangweidong (C), qemu-devel, Huangpeng (Peter)

On Wed, Dec 03, 2014 at 05:50:57PM +0800, Gonglei wrote:
> On 2014/12/3 17:38, Daniel P. Berrange wrote:
> 
> > On Wed, Dec 03, 2014 at 02:55:40PM +0800, arei.gonglei@huawei.com wrote:
> >> From: Gonglei <arei.gonglei@huawei.com>
> >>
> >> A bonus of this feature is that supporting different
> >> people (in different countries) using defferent keyboard
> >> to connect the same guest but not need to configure
> >> command line or libivrt xml file then restart guest.
> >>
> >> Using a new QMP command:
> >>     -> { "execute": "change-vnc-kbd-layout",
> >>                     "arguments": { "keymap": "de" } }
> >>     <- { "return": {}
> >>  
> >> I knew sdl and curses are using keyboard layout, but I don't know
> >> whether they both need to support this feature and add some new
> >> qmp command for them?
> >>
> >> If you have some ideas, please let me know. Thanks!
> > 
> > FWIW users of VNC are much better off not setting any keymap at all
> > in QEMU, and then using a client (such as GTK-VNC) that supports the
> > raw scancode extension. This takes QEMU out of the key remapping
> > business entirely, so that everything "just works" with no extra
> > configuration required in QEMU. This is what SPICE does by default
> > too.
> 
> Actually, my team had received the requirement of changing VNC keyboard
> layout dynamically on the scenario of  Desktop Cloud. The clientele just use
> the simplest tight vnc client, but not GTK-VNC etc. I think we should support
> this scenario, isn't it ?

Personally I think effort is better spent adding support for the keyboard
extension to more of the various VNC clients that exist. Having to issue
monitor commands to change keymap each time a different client wants to
connect is still a pretty sucky solution IMHO.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03  9:54     ` Daniel P. Berrange
@ 2014-12-03 10:04       ` Gonglei
  0 siblings, 0 replies; 20+ messages in thread
From: Gonglei @ 2014-12-03 10:04 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: kraxel, lcapitulino, Huangweidong (C), qemu-devel, Huangpeng (Peter)

On 2014/12/3 17:54, Daniel P. Berrange wrote:

> On Wed, Dec 03, 2014 at 05:50:57PM +0800, Gonglei wrote:
>> On 2014/12/3 17:38, Daniel P. Berrange wrote:
>>
>>> On Wed, Dec 03, 2014 at 02:55:40PM +0800, arei.gonglei@huawei.com wrote:
>>>> From: Gonglei <arei.gonglei@huawei.com>
>>>>
>>>> A bonus of this feature is that supporting different
>>>> people (in different countries) using defferent keyboard
>>>> to connect the same guest but not need to configure
>>>> command line or libivrt xml file then restart guest.
>>>>
>>>> Using a new QMP command:
>>>>     -> { "execute": "change-vnc-kbd-layout",
>>>>                     "arguments": { "keymap": "de" } }
>>>>     <- { "return": {}
>>>>  
>>>> I knew sdl and curses are using keyboard layout, but I don't know
>>>> whether they both need to support this feature and add some new
>>>> qmp command for them?
>>>>
>>>> If you have some ideas, please let me know. Thanks!
>>>
>>> FWIW users of VNC are much better off not setting any keymap at all
>>> in QEMU, and then using a client (such as GTK-VNC) that supports the
>>> raw scancode extension. This takes QEMU out of the key remapping
>>> business entirely, so that everything "just works" with no extra
>>> configuration required in QEMU. This is what SPICE does by default
>>> too.
>>
>> Actually, my team had received the requirement of changing VNC keyboard
>> layout dynamically on the scenario of  Desktop Cloud. The clientele just use
>> the simplest tight vnc client, but not GTK-VNC etc. I think we should support
>> this scenario, isn't it ?
> 
> Personally I think effort is better spent adding support for the keyboard
> extension to more of the various VNC clients that exist.

Your meaning "pass different keymaps to Qemu at command line" one time?

Regards,
-Gonglei

> Having to issue
> monitor commands to change keymap each time a different client wants to
> connect is still a pretty sucky solution IMHO.
> 

> Regards,
> Daniel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03  9:50   ` Gonglei
  2014-12-03  9:54     ` Daniel P. Berrange
@ 2014-12-03 12:10     ` Gerd Hoffmann
  2014-12-04  2:32       ` Gonglei
  1 sibling, 1 reply; 20+ messages in thread
From: Gerd Hoffmann @ 2014-12-03 12:10 UTC (permalink / raw)
  To: Gonglei; +Cc: Huangweidong (C), lcapitulino, qemu-devel, Huangpeng (Peter)

  Hi,

> Hi, Daniel
> Actually, my team had received the requirement of changing VNC keyboard
> layout dynamically on the scenario of  Desktop Cloud. The clientele just use
> the simplest tight vnc client, but not GTK-VNC etc. I think we should support
> this scenario, isn't it ?

It boils down to doing the keysym -> scancode translation on the server
side (tightvnc client, qemu vnc server needs -k) or on the client side
(anything gtk-vnc based, such as virt-viewer / remote-viewer or vinagre
(gnome vnc viewer)).

The big advantage of doing it on the client side (then send the
scancodes using the scancode extension as mentioned by Daniel) is that
it works without any manual configuration, and you can even have two vnc
clients with different local keymaps connected at the same time and
things are still working properly.

In case the client can't do the translation qemu will fallback to do it
on the server side.  It's not the recommended way to operate though.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-03 12:10     ` Gerd Hoffmann
@ 2014-12-04  2:32       ` Gonglei
  2014-12-04  8:47         ` Gerd Hoffmann
  0 siblings, 1 reply; 20+ messages in thread
From: Gonglei @ 2014-12-04  2:32 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Huangweidong (C), lcapitulino, qemu-devel, Huangpeng (Peter)

On 2014/12/3 20:10, Gerd Hoffmann wrote:

>   Hi,
> 
>> Hi, Daniel
>> Actually, my team had received the requirement of changing VNC keyboard
>> layout dynamically on the scenario of  Desktop Cloud. The clientele just use
>> the simplest tight vnc client, but not GTK-VNC etc. I think we should support
>> this scenario, isn't it ?
> 
> It boils down to doing the keysym -> scancode translation on the server
> side (tightvnc client, qemu vnc server needs -k) or on the client side
> (anything gtk-vnc based, such as virt-viewer / remote-viewer or vinagre
> (gnome vnc viewer)).
> 

> The big advantage of doing it on the client side (then send the
> scancodes using the scancode extension as mentioned by Daniel) is that
> it works without any manual configuration, and you can even have two vnc
> clients with different local keymaps connected at the same time and
> things are still working properly.
> 

I see, great thanks for your explanation, Gerd :)

> In case the client can't do the translation qemu will fallback to do it
> on the server side.  It's not the recommended way to operate though.
> 

Hum.. Now, I encountered this situation that the common clienteles just use
tightvnc client, but want to change keymap dynamically. As you say,
the only way address this scenario is doing it on the server side. So,
do you think this patch series make sense and consider to accept it
in upstream? Thanks!

Regards,
-Gonglei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04  2:32       ` Gonglei
@ 2014-12-04  8:47         ` Gerd Hoffmann
  2014-12-04  9:46           ` Gonglei
  0 siblings, 1 reply; 20+ messages in thread
From: Gerd Hoffmann @ 2014-12-04  8:47 UTC (permalink / raw)
  To: Gonglei; +Cc: Huangweidong (C), lcapitulino, qemu-devel, Huangpeng (Peter)

  Hi,

> Hum.. Now, I encountered this situation that the common clienteles just use
> tightvnc client, but want to change keymap dynamically. As you say,
> the only way address this scenario is doing it on the server side. So,
> do you think this patch series make sense and consider to accept it
> in upstream? Thanks!

The alternatives are:

 * Try figure why they are using tightvnc.  Do they simply don't know
   there are other vnc clients such as remote-viewer with much better
   keyboard support?  Did they try other clients and want stick to
   tightvnc nevertheless?  If so, what are the reasons?

 * Try add raw scancode extension support to tightvnc (or the
   http://tigervnc.org/ fork).

I see server-side keymap switching as last ressort if all other
approaches failed, simply because the manual keymap configuration needed
on the server side is error-prone and a pretty bad user experience.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04  8:47         ` Gerd Hoffmann
@ 2014-12-04  9:46           ` Gonglei
  2014-12-04  9:53             ` Daniel P. Berrange
  0 siblings, 1 reply; 20+ messages in thread
From: Gonglei @ 2014-12-04  9:46 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Huangweidong (C), lcapitulino, qemu-devel, Huangpeng (Peter)

On 2014/12/4 16:47, Gerd Hoffmann wrote:

>   Hi,
> 
>> Hum.. Now, I encountered this situation that the common clienteles just use
>> tightvnc client, but want to change keymap dynamically. As you say,
>> the only way address this scenario is doing it on the server side. So,
>> do you think this patch series make sense and consider to accept it
>> in upstream? Thanks!
> 
> The alternatives are:
> 
>  * Try figure why they are using tightvnc.  Do they simply don't know
>    there are other vnc clients such as remote-viewer with much better
>    keyboard support?  Did they try other clients and want stick to
>    tightvnc nevertheless?  If so, what are the reasons?
> 

As far as I can tell, they integrate tightvnc into a web page (tightvnc
realized by Java) as a jar file in Desktop Cloud scenario on windows guests.
I don't know virt-viewing/remote-viewer whether work well on windows
platform?

Regards,
-Gonglei

>  * Try add raw scancode extension support to tightvnc (or the
>    http://tigervnc.org/ fork).
> 
> I see server-side keymap switching as last ressort if all other
> approaches failed, simply because the manual keymap configuration needed
> on the server side is error-prone and a pretty bad user experience.
> 
> cheers,
>   Gerd
> 
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04  9:46           ` Gonglei
@ 2014-12-04  9:53             ` Daniel P. Berrange
  2014-12-04 10:18               ` Gonglei
  2014-12-04 12:07               ` Gonglei
  0 siblings, 2 replies; 20+ messages in thread
From: Daniel P. Berrange @ 2014-12-04  9:53 UTC (permalink / raw)
  To: Gonglei
  Cc: Huangpeng (Peter), lcapitulino, Huangweidong (C),
	Gerd Hoffmann, qemu-devel

On Thu, Dec 04, 2014 at 05:46:22PM +0800, Gonglei wrote:
> On 2014/12/4 16:47, Gerd Hoffmann wrote:
> 
> >   Hi,
> > 
> >> Hum.. Now, I encountered this situation that the common clienteles just use
> >> tightvnc client, but want to change keymap dynamically. As you say,
> >> the only way address this scenario is doing it on the server side. So,
> >> do you think this patch series make sense and consider to accept it
> >> in upstream? Thanks!
> > 
> > The alternatives are:
> > 
> >  * Try figure why they are using tightvnc.  Do they simply don't know
> >    there are other vnc clients such as remote-viewer with much better
> >    keyboard support?  Did they try other clients and want stick to
> >    tightvnc nevertheless?  If so, what are the reasons?
> > 
> 
> As far as I can tell, they integrate tightvnc into a web page (tightvnc
> realized by Java) as a jar file in Desktop Cloud scenario on windows guests.
> I don't know virt-viewing/remote-viewer whether work well on windows
> platform?

We do now provide Windows builds of viewer-viewer + remote-viewer
in a single MSI installer for Win 32 & 64 bit

  http://virt-manager.org/download/


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04  9:53             ` Daniel P. Berrange
@ 2014-12-04 10:18               ` Gonglei
  2014-12-04 12:07               ` Gonglei
  1 sibling, 0 replies; 20+ messages in thread
From: Gonglei @ 2014-12-04 10:18 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: Huangpeng (Peter), lcapitulino, Huangweidong (C),
	Gerd Hoffmann, qemu-devel

On 2014/12/4 17:53, Daniel P. Berrange wrote:

> On Thu, Dec 04, 2014 at 05:46:22PM +0800, Gonglei wrote:
>> On 2014/12/4 16:47, Gerd Hoffmann wrote:
>>
>>>   Hi,
>>>
>>>> Hum.. Now, I encountered this situation that the common clienteles just use
>>>> tightvnc client, but want to change keymap dynamically. As you say,
>>>> the only way address this scenario is doing it on the server side. So,
>>>> do you think this patch series make sense and consider to accept it
>>>> in upstream? Thanks!
>>>
>>> The alternatives are:
>>>
>>>  * Try figure why they are using tightvnc.  Do they simply don't know
>>>    there are other vnc clients such as remote-viewer with much better
>>>    keyboard support?  Did they try other clients and want stick to
>>>    tightvnc nevertheless?  If so, what are the reasons?
>>>
>>
>> As far as I can tell, they integrate tightvnc into a web page (tightvnc
>> realized by Java) as a jar file in Desktop Cloud scenario on windows guests.
>> I don't know virt-viewing/remote-viewer whether work well on windows
>> platform?
> 
> We do now provide Windows builds of viewer-viewer + remote-viewer
> in a single MSI installer for Win 32 & 64 bit
> 
>   http://virt-manager.org/download/
> 

Thanks. I will have a try.

Regards,
-Gonglei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04  9:53             ` Daniel P. Berrange
  2014-12-04 10:18               ` Gonglei
@ 2014-12-04 12:07               ` Gonglei
  2014-12-04 12:10                 ` Daniel P. Berrange
  1 sibling, 1 reply; 20+ messages in thread
From: Gonglei @ 2014-12-04 12:07 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: Huangpeng (Peter), lcapitulino, Huangweidong (C),
	Gerd Hoffmann, qemu-devel

On 2014/12/4 17:53, Daniel P. Berrange wrote:

> We do now provide Windows builds of viewer-viewer + remote-viewer
> in a single MSI installer for Win 32 & 64 bit
> 
>   http://virt-manager.org/download/

Hi,

I had installed virt-viewer-x86-1.0.msi on my windows machine,
and I connected the guest with remote-viewer successfully. But
I don't know how to enable this vnc client's raw scancode extension
capability so that I can use 'en-us' keymap to my guest booted with
'-k de' (in command line). Any documents or FAQ? Thanks,

Regards,
-Gonglei

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04 12:07               ` Gonglei
@ 2014-12-04 12:10                 ` Daniel P. Berrange
  2014-12-04 12:16                   ` Gonglei
  0 siblings, 1 reply; 20+ messages in thread
From: Daniel P. Berrange @ 2014-12-04 12:10 UTC (permalink / raw)
  To: Gonglei
  Cc: Huangpeng (Peter), lcapitulino, Huangweidong (C),
	Gerd Hoffmann, qemu-devel

On Thu, Dec 04, 2014 at 08:07:14PM +0800, Gonglei wrote:
> On 2014/12/4 17:53, Daniel P. Berrange wrote:
> 
> > We do now provide Windows builds of viewer-viewer + remote-viewer
> > in a single MSI installer for Win 32 & 64 bit
> > 
> >   http://virt-manager.org/download/
> 
> Hi,
> 
> I had installed virt-viewer-x86-1.0.msi on my windows machine,
> and I connected the guest with remote-viewer successfully. But
> I don't know how to enable this vnc client's raw scancode extension
> capability so that I can use 'en-us' keymap to my guest booted with
> '-k de' (in command line). Any documents or FAQ? Thanks,

Just remove the keymap setting from your QEMU configuration entirely.

Then you simply need to configure your guest OS desktop to have the
same keymap as your client machine.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically
  2014-12-04 12:10                 ` Daniel P. Berrange
@ 2014-12-04 12:16                   ` Gonglei
  0 siblings, 0 replies; 20+ messages in thread
From: Gonglei @ 2014-12-04 12:16 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: Huangpeng (Peter), lcapitulino, Huangweidong (C),
	Gerd Hoffmann, qemu-devel

On 2014/12/4 20:10, Daniel P. Berrange wrote:

> On Thu, Dec 04, 2014 at 08:07:14PM +0800, Gonglei wrote:
>> On 2014/12/4 17:53, Daniel P. Berrange wrote:
>>
>>> We do now provide Windows builds of viewer-viewer + remote-viewer
>>> in a single MSI installer for Win 32 & 64 bit
>>>
>>>   http://virt-manager.org/download/
>>
>> Hi,
>>
>> I had installed virt-viewer-x86-1.0.msi on my windows machine,
>> and I connected the guest with remote-viewer successfully. But
>> I don't know how to enable this vnc client's raw scancode extension
>> capability so that I can use 'en-us' keymap to my guest booted with
>> '-k de' (in command line). Any documents or FAQ? Thanks,
> 
> Just remove the keymap setting from your QEMU configuration entirely.
> 
> Then you simply need to configure your guest OS desktop to have the
> same keymap as your client machine.
> 

OK. Thanks  :)

Regards,
-Gonglei

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-12-04 12:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03  6:55 [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 1/6] vnc: introduce vnc_display_kbd_layout function arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 2/6] vnc: add a new QMP command for changing keyboard layout arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 3/6] vnc: HMP change-vnc-kbd-layout wrapper arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 4/6] qapi-schema: fix typo about change-vnc-password arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 5/6] keymaps: correct keymaps.c following Qemu coding style arei.gonglei
2014-12-03  6:55 ` [Qemu-devel] [RFC PATCH v2 6/6] keymaps: convert fprintf to qerror_report arei.gonglei
2014-12-03  9:38 ` [Qemu-devel] [RFC PATCH v2 0/6] Support to change VNC keyboard layout dynamically Daniel P. Berrange
2014-12-03  9:50   ` Gonglei
2014-12-03  9:54     ` Daniel P. Berrange
2014-12-03 10:04       ` Gonglei
2014-12-03 12:10     ` Gerd Hoffmann
2014-12-04  2:32       ` Gonglei
2014-12-04  8:47         ` Gerd Hoffmann
2014-12-04  9:46           ` Gonglei
2014-12-04  9:53             ` Daniel P. Berrange
2014-12-04 10:18               ` Gonglei
2014-12-04 12:07               ` Gonglei
2014-12-04 12:10                 ` Daniel P. Berrange
2014-12-04 12:16                   ` Gonglei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.