Commit 29b2517a authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20160803-1' 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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 6eac5f7b 12e29b16
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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();