Blob Blame History Raw
From d8e67658b944a2b0f235c4384909c2efce4671bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Fri, 9 Jun 2017 14:23:37 +0200
Subject: [PATCH 1/4] vnc: allow to connect with add_client when -vnc none
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: <20170609142337.10457-1-marcandre.lureau@redhat.com>
Patchwork-id: 75568
O-Subject: [RHEL-7.4 qemu-kvm PATCH] vnc: allow to connect with add_client when -vnc none
Bugzilla: 1435352
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

Do not skip VNC initialization, in particular of auth method when vnc is
configured without sockets, since we should still allow connections
through QMP add_client.

Upstream-status: similar to commit fa03cb7fd212. However, the upstream
code changed significantly, so the patch is different.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 ui/vnc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 1834db0..29b216c 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2993,8 +2993,6 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
         return;
     }
     vnc_display_close(ds);
-    if (strcmp(display, "none") == 0)
-        return;
 
     vs->display = g_strdup(display);
     vs->share_policy = VNC_SHARE_POLICY_ALLOW_EXCLUSIVE;
@@ -3219,7 +3217,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
             goto fail;
         }
         vnc_connect(vs, csock, 0, 0);
-    } else {
+    } else if (strcmp(display, "none")) {
         /* listen for connects */
         char *dpy;
         dpy = g_malloc(256);
-- 
1.8.3.1