-
Couldn't load subscription status.
- Fork 67
CP-17631: Don't use a default QEMU keymap #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
|
Depends on xapi-project/xen-api#2676 |
xc/device.ml
Outdated
| with _ -> None | ||
|
|
||
| let cmdline_of_disp info = | ||
| let combine_opts : bytes list option list -> bytes list = fun opts -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define a type synonym for bytes list to make this signature read a bit more easily. For example:
type params = bytes list
let cmdline_of_disp info =
let combine_opts : params option list -> params = fun opts ->
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moot if I do what you asked in #272 (diff)
| let vnc_opt = Some ["-vnc"; ip_addr ^ ":" ^ port] in | ||
| let keymap_opt = Some ["-k"; keymap] in | ||
| combine_opts [unused_opt; vnc_opt; keymap_opt] | ||
| in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get the same effect without needing the combine_opts function:
let vnc_opts_of ip_addr_opt auto port keymap =
let ip_addr = Opt.default "127.0.0.1" ip_addr_opt in
let port = if auto then "1" else string_of_int port in
let unused_opt = if auto then ["-vncunused"] else [] in
let vnc_opt = ["-vnc"; ip_addr ^ ":" ^ port] in
let keymap_opt = ["-k"; keymap] in
List.flatten [unused_opt; vnc_opt; keymap_opt]You should be able to make similar changes in other functions which are using combine_opts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll do this, and for the vga opts too.
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
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>
|
@euanh I think I've resolved all the style problems. Removing the "needs updating" and "reviewed" labels. Can you confirm you're happy (or otherwise)? |
|
|
Until now we have been defaulting the keymap to
en-usbut thisprevents 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-usanyway 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
-koption.Signed-off-by: Si Beaumont simon.beaumont@citrix.com