1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-10-26 07:34:04 +03:00

Added support for keymap in VNC display

This commit is contained in:
Daniel P. Berrange
2007-03-06 20:00:17 +00:00
parent 8cb208cd57
commit 955f12037e
21 changed files with 77 additions and 39 deletions

View File

@@ -1587,11 +1587,13 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
} else if (tmp && !strcmp(tmp, "vnc")) {
int port = xenStoreDomainGetVNCPort(conn, domid);
const char *listenAddr = sexpr_node(node, "device/vfb/vnclisten");
if (listenAddr) {
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d' listen='%s'/>\n", port, listenAddr);
} else {
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d'/>\n", port);
}
const char *keymap = sexpr_node(node, "device/vfb/keymap");
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d'", port);
if (listenAddr)
virBufferVSprintf(&buf, " listen='%s'", listenAddr);
if (keymap)
virBufferVSprintf(&buf, " keymap='%s'", keymap);
virBufferAdd(&buf, "/>\n", 3);
}
}
}
@@ -1632,6 +1634,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
if (tmp[0] == '1') {
int port = xenStoreDomainGetVNCPort(conn, domid);
const char *listenAddr = sexpr_fmt_node(root, "domain/image/%s/vnclisten", hvm ? "hvm" : "linux");
const char *keymap = sexpr_fmt_node(root, "domain/image/%s/keymap", hvm ? "hvm" : "linux");
/* For Xen >= 3.0.3, don't generate a fixed port mapping
* because it will almost certainly be wrong ! Just leave
* it as -1 which lets caller see that the VNC server isn't
@@ -1640,10 +1643,12 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
*/
if (port == -1 && xendConfigVersion < 2)
port = 5900 + domid;
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d'", port);
if (listenAddr)
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d' listen='%s'/>\n", port, listenAddr);
else
virBufferVSprintf(&buf, " <graphics type='vnc' port='%d'/>\n", port);
virBufferVSprintf(&buf, " listen='%s'", listenAddr);
if (keymap)
virBufferVSprintf(&buf, " keymap='%s'", keymap);
virBufferAdd(&buf, "/>\n", 3);
}
}