aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc-jobs.h
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2012-03-14 07:58:47 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-03-14 16:22:46 -0500
commit175b2a6e4be06422da59d3a82c28d9a0e738e282 (patch)
tree109f343f1e5207c3c6a2fc4c339465f4a1e81dc6 /ui/vnc-jobs.h
parent418ba9e5d6849ef2e8512d8853628ce4bf37937a (diff)
downloadqemu-175b2a6e4be06422da59d3a82c28d9a0e738e282.zip
qemu-175b2a6e4be06422da59d3a82c28d9a0e738e282.tar.gz
qemu-175b2a6e4be06422da59d3a82c28d9a0e738e282.tar.bz2
vnc: don't mess up with iohandlers in the vnc thread
The threaded VNC servers messed up with QEMU fd handlers without any kind of locking, and that can cause some nasty race conditions. Using qemu_mutex_lock_iothread() won't work because vnc_dpy_cpy(), which will wait for the current job queue to finish, can be called with the iothread lock held. Instead, we now store the data in a temporary buffer, and use a bottom half to notify the main thread that new data is available. vnc_[un]lock_ouput() is still needed to access VncState members like abort, csock or jobs_buffer. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/vnc-jobs.h')
-rw-r--r--ui/vnc-jobs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/vnc-jobs.h b/ui/vnc-jobs.h
index b8dab81..4c661f9 100644
--- a/ui/vnc-jobs.h
+++ b/ui/vnc-jobs.h
@@ -40,6 +40,7 @@ void vnc_jobs_join(VncState *vs);
#ifdef CONFIG_VNC_THREAD
+void vnc_jobs_consume_buffer(VncState *vs);
void vnc_start_worker_thread(void);
bool vnc_worker_thread_running(void);
void vnc_stop_worker_thread(void);