vnc: fixes for "-vnc none".

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJXog6zAAoJEEy22O7T6HE4RCgP/2qdRZPbzC0KF1PVpcOF+YOt
 qHN/DZ7X7PCf+JSl8H6VwQJK2cZaCr0BAoDb9OvIRZYESLZJu887tpyWZ13eL3gV
 fMkqf009uyh8ockNmda/STzxDf6BTDNthuU07DNfg2YAdxWtRdLSsRwLQbI5P2EG
 +2qUXu1XTq//k007el023W8OAuGyBDZ6zwnff09b0gLtV3w1O8JyMw9x2WP6tT4x
 3+xXZqs1W1eJ/Df8Re1LKtDZxV7HoPrR58KEm6eEJDajRYJqZFyDcoYMah6wHkb+
 03lUVRwGLBcGUkYqmMArhUJfugv1Mc+ZosYtdhxEARQnsjyvF26Xqq0BKD177k8E
 xd13l9to6vTJVMd4O0sKwW/Q/EIrzz5dnsPayv5dj/3aRcjD5gnqPTLx6RO/CKLE
 kEIjwxbRVoqn2rIkDMn+AVpyj9RAqt7pXQtb1V+KBXSOXWcnuMc/M1j7ueGt+dt+
 gh5LIKpJSHNm9M9H2EnxIhDN6bwnA3La6c9YhIviYGpvm3Ib23lBzyf2ySV8FIkV
 FDi57xYo3lzYj1UV+/jLCi+pLJMUU2HB8YUc1fIMv+UqF7dcgvxoXIsHibBE8Xew
 dSIYo0S4/Q9v1QJw3zf4DxMFBKfoyWqLHLty26fEFKwazOZn3TF7Cg8mmjG4AW4R
 OcKv6cOSHU6dZvtKt2Rr
 =Eu3k
 -----END PGP SIGNATURE-----

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: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2016-08-03 18:22:51 +01:00
commit 29b2517ac7

View File

@ -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();