@@ -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;
@@ -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);