ui: vnc and keymap updates for 2.10

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZbIWDAAoJEEy22O7T6HE40nEP/3+KejBHAh1OAYQ706Act6u8
 p3LXnEAUuaPVkSTFiuOVgkJrE6qFRkQ6kRPtJbFIj5J1XW/+kXDwpVHqRfatyDEb
 /lJ+su8PZ6MsPvy6SdxMBYMtyPuJ7s5GQ+/3zuKnGtIUJLRQElX+Us+mCQ0c1Ugq
 8bhUGIi5QSlCe8Db+wqnhdMrlZmVmhjoruVRhildI7ytpoAdEh6Vol8GHCsMWkJ/
 iTocBSpjgI+P7+/YiouopIfNwmLMXVwOME48IAUyhZj4V66jF8bguwn3HUxCyIuX
 H5AQVm7TCtQ40EgXBHSSdp3vMihdWEIw03rFBohcJsi4Uf9KHFYZsLWdNy6/Veqr
 MP8dJgPJT4xMs9eSLiCYW7K1Mj9F4xsXkYVt4gc/25aCyk/T1iOWYS/wA6c/2tM5
 UCD5Gd4UnwuGsnJSsU4+oAnZmDYnjjd4HbzSB6jG9a6RoFRmZ221eSNuXLUoLFyN
 nTYpfA/H6etl93Zvse6DS/MdJPdgIsk8mpHTALROY3FhOKJmUALd93N2zL7qSTOK
 CCJQrgFMwCvlg5teejubSWnauyzB3YInqQBHiZDLif0xV6at2PbjevX/7xBNKa5R
 s0SAZt/c1DEt+YudG0Ga+PXEcrUr2sHQF8pfNLf2gfag4SOo2gCKlTnHoaDUSky4
 5xY0r8fwZgvkzN2Vmz2l
 =I81A
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170717-pull-request' into staging

ui: vnc and keymap updates for 2.10

# gpg: Signature made Mon 17 Jul 2017 10:38:11 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20170717-pull-request:
  keymaps: fr-ca: add missing keys
  hmp: Update info vnc
  vnc: Set default kbd delay to 10ms

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-07-17 16:31:30 +01:00
commit 3408d5aee0
4 changed files with 77 additions and 33 deletions

102
hmp.c
View File

@ -600,50 +600,92 @@ void hmp_info_blockstats(Monitor *mon, const QDict *qdict)
qapi_free_BlockStatsList(stats_list);
}
/* Helper for hmp_info_vnc_clients, _servers */
static void hmp_info_VncBasicInfo(Monitor *mon, VncBasicInfo *info,
const char *name)
{
monitor_printf(mon, " %s: %s:%s (%s%s)\n",
name,
info->host,
info->service,
NetworkAddressFamily_lookup[info->family],
info->websocket ? " (Websocket)" : "");
}
/* Helper displaying and auth and crypt info */
static void hmp_info_vnc_authcrypt(Monitor *mon, const char *indent,
VncPrimaryAuth auth,
VncVencryptSubAuth *vencrypt)
{
monitor_printf(mon, "%sAuth: %s (Sub: %s)\n", indent,
VncPrimaryAuth_lookup[auth],
vencrypt ? VncVencryptSubAuth_lookup[*vencrypt] : "none");
}
static void hmp_info_vnc_clients(Monitor *mon, VncClientInfoList *client)
{
while (client) {
VncClientInfo *cinfo = client->value;
hmp_info_VncBasicInfo(mon, qapi_VncClientInfo_base(cinfo), "Client");
monitor_printf(mon, " x509_dname: %s\n",
cinfo->has_x509_dname ?
cinfo->x509_dname : "none");
monitor_printf(mon, " sasl_username: %s\n",
cinfo->has_sasl_username ?
cinfo->sasl_username : "none");
client = client->next;
}
}
static void hmp_info_vnc_servers(Monitor *mon, VncServerInfo2List *server)
{
while (server) {
VncServerInfo2 *sinfo = server->value;
hmp_info_VncBasicInfo(mon, qapi_VncServerInfo2_base(sinfo), "Server");
hmp_info_vnc_authcrypt(mon, " ", sinfo->auth,
sinfo->has_vencrypt ? &sinfo->vencrypt : NULL);
server = server->next;
}
}
void hmp_info_vnc(Monitor *mon, const QDict *qdict)
{
VncInfo *info;
VncInfo2List *info2l;
Error *err = NULL;
VncClientInfoList *client;
info = qmp_query_vnc(&err);
info2l = qmp_query_vnc_servers(&err);
if (err) {
error_report_err(err);
return;
}
if (!info->enabled) {
monitor_printf(mon, "Server: disabled\n");
goto out;
if (!info2l) {
monitor_printf(mon, "None\n");
return;
}
monitor_printf(mon, "Server:\n");
if (info->has_host && info->has_service) {
monitor_printf(mon, " address: %s:%s\n", info->host, info->service);
while (info2l) {
VncInfo2 *info = info2l->value;
monitor_printf(mon, "%s:\n", info->id);
hmp_info_vnc_servers(mon, info->server);
hmp_info_vnc_clients(mon, info->clients);
if (!info->server) {
/* The server entry displays its auth, we only
* need to display in the case of 'reverse' connections
* where there's no server.
*/
hmp_info_vnc_authcrypt(mon, " ", info->auth,
info->has_vencrypt ? &info->vencrypt : NULL);
}
if (info->has_auth) {
monitor_printf(mon, " auth: %s\n", info->auth);
if (info->has_display) {
monitor_printf(mon, " Display: %s\n", info->display);
}
info2l = info2l->next;
}
if (!info->has_clients || info->clients == NULL) {
monitor_printf(mon, "Client: none\n");
} else {
for (client = info->clients; client; client = client->next) {
monitor_printf(mon, "Client:\n");
monitor_printf(mon, " address: %s:%s\n",
client->value->host,
client->value->service);
monitor_printf(mon, " x509_dname: %s\n",
client->value->x509_dname ?
client->value->x509_dname : "none");
monitor_printf(mon, " username: %s\n",
client->value->has_sasl_username ?
client->value->sasl_username : "none");
}
}
qapi_free_VncInfo2List(info2l);
out:
qapi_free_VncInfo(info);
}
#ifdef CONFIG_SPICE

View File

@ -48,3 +48,5 @@ parenleft 0xa shift
parenright 0xb shift
underscore 0xc shift
plus 0xd shift
minus 0xc
equal 0xd

View File

@ -1753,7 +1753,7 @@ spec but is traditional QEMU behavior.
@item key-delay-ms
Set keyboard delay, for key down and key up events, in milliseconds.
Default is 1. Keyboards are low-bandwidth devices, so this slowdown
Default is 10. Keyboards are low-bandwidth devices, so this slowdown
can help the device and guest to keep up and not lose events in case
events are arriving in bulk. Possible causes for the latter are flaky
network connections, or scripts for automated testing.

View File

@ -3808,7 +3808,7 @@ void vnc_display_open(const char *id, Error **errp)
}
lock_key_sync = qemu_opt_get_bool(opts, "lock-key-sync", true);
key_delay_ms = qemu_opt_get_number(opts, "key-delay-ms", 1);
key_delay_ms = qemu_opt_get_number(opts, "key-delay-ms", 10);
sasl = qemu_opt_get_bool(opts, "sasl", false);
#ifndef CONFIG_VNC_SASL
if (sasl) {