summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-10-30 12:10:10 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-11-05 09:09:27 +0100
commit2e0c90af0a33451498d333d72c06e5429c7cd168 (patch)
tree3ab64c9859e840b54b648e99ead2eb53f396e99e
parentc7628bff4138ce906a3620d12e0820c1cf6c140d (diff)
downloadfocaccia-qemu-2e0c90af0a33451498d333d72c06e5429c7cd168.tar.gz
focaccia-qemu-2e0c90af0a33451498d333d72c06e5429c7cd168.zip
vnc: fix local state init
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1446203414-4013-16-git-send-email-kraxel@redhat.com
-rw-r--r--ui/vnc-jobs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index fd9ed39f26..12389cc2e8 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -185,6 +185,9 @@ void vnc_jobs_consume_buffer(VncState *vs)
  */
 static void vnc_async_encoding_start(VncState *orig, VncState *local)
 {
+    buffer_init(&local->output, "vnc-worker-output");
+    local->csock = -1; /* Don't do any network work on this thread */
+
     local->vnc_encoding = orig->vnc_encoding;
     local->features = orig->features;
     local->vd = orig->vd;
@@ -196,7 +199,6 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local)
     local->zlib = orig->zlib;
     local->hextile = orig->hextile;
     local->zrle = orig->zrle;
-    local->csock = -1; /* Don't do any network work on this thread */
 }
 
 static void vnc_async_encoding_end(VncState *orig, VncState *local)
@@ -212,12 +214,10 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
 {
     VncJob *job;
     VncRectEntry *entry, *tmp;
-    VncState vs;
+    VncState vs = {};
     int n_rectangles;
     int saved_offset;
 
-    buffer_init(&vs.output, "vnc-worker-output");
-
     vnc_lock_queue(queue);
     while (QTAILQ_EMPTY(&queue->jobs) && !queue->exit) {
         qemu_cond_wait(&queue->cond, &queue->mutex);