Skip to content

Commit 2e15dd3

Browse files
CP-17631: Don't use a default QEMU keymap
Until now we have been defaulting the keymap to `en-us` but this prevents VNC clients from using the QEMU ExtendedKeyEvent extension for passing raw scan codes. If a keymap is not passed to QEMU, it will default to using `en-us` anyway but will enable the ExtendedKeyEvent extension. This does not change the behaviour for when a keymap has actually been specified. In this case, it is still honoured and passed to QEMU with the `-k` option. Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
1 parent 7dfcc28 commit 2e15dd3

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

xc/device.ml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ type disp_intf_opt =
14181418
(* Display output / keyboard input *)
14191419
type disp_opt =
14201420
| NONE
1421-
| VNC of disp_intf_opt * string option * bool * int * string (* IP address, auto-allocate, port if previous false, keymap *)
1421+
| VNC of disp_intf_opt * string option * bool * int * string option (* IP address, auto-allocate, port if previous false, keymap *)
14221422
| SDL of disp_intf_opt * string (* X11 display *)
14231423

14241424
type media = Disk | Cdrom
@@ -1537,12 +1537,11 @@ let cmdline_of_disp info =
15371537
"-vgt_low_gm_sz"; Int64.to_string gvt_g.low_gm_sz;
15381538
"-vgt_high_gm_sz"; Int64.to_string gvt_g.high_gm_sz;
15391539
"-vgt_fence_sz"; Int64.to_string gvt_g.fence_sz;
1540-
] in
1541-
let config_file_opt = match gvt_g.monitor_config_file with
1540+
]
1541+
and config_file_opt = match gvt_g.monitor_config_file with
15421542
| Some path -> Some ["-vgt_monitor_config_file"; path]
15431543
| None -> None
1544-
in
1545-
let priv_opt = Some ["-priv"] in
1544+
and priv_opt = Some ["-priv"] in
15461545
combine_opts [base_opts; config_file_opt; priv_opt]
15471546
| Vgpu _ -> failwith "Unsupported vGPU configuration"
15481547
| Std_vga -> ["-std-vga"]
@@ -1555,7 +1554,7 @@ let cmdline_of_disp info =
15551554
let port = if auto then "1" else string_of_int port in
15561555
let unused_opt = if auto then Some ["-vncunused"] else None in
15571556
let vnc_opt = Some ["-vnc"; ip_addr ^ ":" ^ port] in
1558-
let keymap_opt = Some ["-k"; keymap] in
1557+
let keymap_opt = Opt.map (fun keymap -> ["-k"; keymap]) keymap in
15591558
combine_opts [unused_opt; vnc_opt; keymap_opt]
15601559
in
15611560
let disp_options, wait_for_port =

xc/device.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ sig
178178

179179
type disp_opt =
180180
| NONE
181-
| VNC of disp_intf_opt * string option * bool * int * string (* IP address, auto-allocate, port if previous false, keymap *)
181+
| VNC of disp_intf_opt * string option * bool * int * string option (* IP address, auto-allocate, port if previous false, keymap *)
182182
| SDL of disp_intf_opt * string (* X11 display *)
183183

184184
type media = Disk | Cdrom

xc/xenops_server_xen.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ module VM = struct
11021102
?(nics=[]) ?(disks=[]) ?(vgpus=[])
11031103
?(pci_emulations=[]) ?(usb=Device.Dm.Disabled)
11041104
?(parallel=None)
1105-
?(acpi=true) ?(video=Cirrus) ?(keymap="en-us")
1105+
?(acpi=true) ?(video=Cirrus) ?keymap
11061106
?vnc_ip ?(pci_passthrough=false) ?(hvm=true) ?(video_mib=4) () =
11071107
let video = match video, vgpus with
11081108
| Cirrus, [] -> Device.Dm.Cirrus

0 commit comments

Comments
 (0)