Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20160803-1…
Browse files Browse the repository at this point in the history
…' into staging

vnc: fixes for "-vnc none".

# gpg: Signature made Wed 03 Aug 2016 16:33:07 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/pull-vnc-20160803-1:
  vnc: ensure connection sharing/limits is always configured
  vnc: fix crash when vnc_server_info_get has an error
  vnc: don't crash getting server info if lsock is NULL

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Aug 3, 2016
2 parents 6eac5f7 + 12e29b1 commit 29b2517
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/vnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc,
{
SocketAddress *addr = NULL;

if (!ioc) {
error_setg(errp, "No listener socket available");
return;
}

addr = qio_channel_socket_get_local_address(ioc, errp);
if (!addr) {
return;
Expand Down Expand Up @@ -219,7 +224,7 @@ static VncServerInfo *vnc_server_info_get(VncDisplay *vd)
VncServerInfo *info;
Error *err = NULL;

info = g_malloc(sizeof(*info));
info = g_malloc0(sizeof(*info));
vnc_init_basic_info_from_server_addr(vd->lsock,
qapi_VncServerInfo_base(info), &err);
info->has_auth = true;
Expand Down Expand Up @@ -3145,6 +3150,9 @@ void vnc_display_init(const char *id)
if (!vs->kbd_layout)
exit(1);

vs->share_policy = VNC_SHARE_POLICY_ALLOW_EXCLUSIVE;
vs->connections_limit = 32;

qemu_mutex_init(&vs->mutex);
vnc_start_worker_thread();

Expand Down

0 comments on commit 29b2517

Please sign in to comment.