mirror of https://gitee.com/openkylin/qemu.git
vnc bugfixes.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJU/sl/AAoJEEy22O7T6HE4LukP/07iHj+f3/9kZZzzE92urNJx NwXfdWvx+cr6bRHmkuoab6W14HZnsuwPOP8k6sHJnA5Jxl0IhFF9UsZZwrNXC9GB S1za5jd63C6ZsSP1FaItFTsd4ENAfjoeu1+92qNqnxJzQqttaMnTPPeNZXmyD+1n WZJwEMIffY9qukgZhaZwhPY0igjZHMrrkB4xoIUbCOUwL/t2tadXwQmdZzROwNsB Uslr34Tl7bC0vuNo6ZAed8OTI4cCqA/3N0W3xKOYrsFNjhRN+F4MDGtuAFlSzNJj tZFF4a73KKcWvFnTNMN1CUNSJd9+CGTc5gEmqie6yRHdNiEgCQTwGg69j3mODd/J 3OBHdqK26hyzgvtFVEatcOA93YKDlFNJGidqVUpsGBS9mD3s/ddBZAsx0lv9evHC ejGhR22z6P7MeOIv3nig1lE9rDWw/It07wWTtQMK4XzZexYZNPbiB/0wdYqcgRVk YuVMcStl8EGB2S/CeWoILVWGy7PsJMV2OLZHzw5IrWwrRClQP4N0aA2t09aIPvMQ u0imH6fsj4Nv/pCys+nONvRgIRZDLBV5/amTJzMB2kUcUWohGAQ6Cj3dgdMec0xA PlpEZM8PaxC9wxRp6nZ0bMV3xN5oZTR6dWTDvP7NcrrvaZw30Sp7t7/SlDmx/oIG /yDiLcNWiCzhmQD2fWjg =mH6B -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150310-1' into staging vnc bugfixes. # gpg: Signature made Tue Mar 10 10:37:51 2015 GMT using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-vnc-20150310-1: Fix crash when connecting to VNC through websocket vnc: -readconfig fix vnc: set id at parse time not init time Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
21025c29f5
|
@ -332,7 +332,6 @@ void vnc_display_init(const char *id);
|
|||
void vnc_display_open(const char *id, Error **errp);
|
||||
void vnc_display_add_client(const char *id, int csock, bool skipauth);
|
||||
char *vnc_display_local_addr(const char *id);
|
||||
void vnc_auto_assign_id(QemuOptsList *olist, QemuOpts *opts);
|
||||
#ifdef CONFIG_VNC
|
||||
int vnc_display_password(const char *id, const char *password);
|
||||
int vnc_display_pw_expire(const char *id, time_t expires);
|
||||
|
|
1
qmp.c
1
qmp.c
|
@ -391,7 +391,6 @@ static void qmp_change_vnc_listen(const char *target, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
vnc_auto_assign_id(olist, opts);
|
||||
vnc_display_open("default", errp);
|
||||
}
|
||||
|
||||
|
|
|
@ -207,8 +207,7 @@ static void vncws_send_handshake_response(VncState *vs, const char* key)
|
|||
}
|
||||
|
||||
response = g_strdup_printf(WS_HANDSHAKE, accept);
|
||||
vnc_write(vs, response, strlen(response));
|
||||
vnc_flush(vs);
|
||||
vnc_client_write_buf(vs, (const uint8_t *)response, strlen(response));
|
||||
|
||||
g_free(accept);
|
||||
g_free(response);
|
||||
|
|
22
ui/vnc.c
22
ui/vnc.c
|
@ -3687,12 +3687,7 @@ void vnc_display_add_client(const char *id, int csock, bool skipauth)
|
|||
vnc_connect(vs, csock, skipauth, false);
|
||||
}
|
||||
|
||||
QemuOpts *vnc_parse_func(const char *str)
|
||||
{
|
||||
return qemu_opts_parse(qemu_find_opts("vnc"), str, 1);
|
||||
}
|
||||
|
||||
void vnc_auto_assign_id(QemuOptsList *olist, QemuOpts *opts)
|
||||
static void vnc_auto_assign_id(QemuOptsList *olist, QemuOpts *opts)
|
||||
{
|
||||
int i = 2;
|
||||
char *id;
|
||||
|
@ -3705,18 +3700,25 @@ void vnc_auto_assign_id(QemuOptsList *olist, QemuOpts *opts)
|
|||
qemu_opts_set_id(opts, id);
|
||||
}
|
||||
|
||||
int vnc_init_func(QemuOpts *opts, void *opaque)
|
||||
QemuOpts *vnc_parse_func(const char *str)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
QemuOptsList *olist = qemu_find_opts("vnc");
|
||||
char *id = (char *)qemu_opts_id(opts);
|
||||
QemuOpts *opts = qemu_opts_parse(olist, str, 1);
|
||||
const char *id = qemu_opts_id(opts);
|
||||
|
||||
if (!id) {
|
||||
/* auto-assign id if not present */
|
||||
vnc_auto_assign_id(olist, opts);
|
||||
id = (char *)qemu_opts_id(opts);
|
||||
}
|
||||
return opts;
|
||||
}
|
||||
|
||||
int vnc_init_func(QemuOpts *opts, void *opaque)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
char *id = (char *)qemu_opts_id(opts);
|
||||
|
||||
assert(id);
|
||||
vnc_display_init(id);
|
||||
vnc_display_open(id, &local_err);
|
||||
if (local_err != NULL) {
|
||||
|
|
7
vl.c
7
vl.c
|
@ -2001,7 +2001,6 @@ static DisplayType select_display(const char *p)
|
|||
} else if (strstart(p, "vnc", &opts)) {
|
||||
#ifdef CONFIG_VNC
|
||||
if (*opts == '=') {
|
||||
display_remote++;
|
||||
if (vnc_parse_func(opts+1) == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
@ -3477,7 +3476,6 @@ int main(int argc, char **argv, char **envp)
|
|||
break;
|
||||
case QEMU_OPTION_vnc:
|
||||
#ifdef CONFIG_VNC
|
||||
display_remote++;
|
||||
if (vnc_parse_func(optarg) == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
@ -3970,6 +3968,11 @@ int main(int argc, char **argv, char **envp)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_VNC)
|
||||
if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
|
||||
display_remote++;
|
||||
}
|
||||
#endif
|
||||
if (display_type == DT_DEFAULT && !display_remote) {
|
||||
#if defined(CONFIG_GTK)
|
||||
display_type = DT_GTK;
|
||||
|
|
Loading…
Reference in New Issue