]> git.proxmox.com Git - mirror_qemu.git/commit - ui/vnc-jobs.h
vnc: don't mess up with iohandlers in the vnc thread
authorCorentin Chary <corentin.chary@gmail.com>
Wed, 14 Mar 2012 06:58:47 +0000 (07:58 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 14 Mar 2012 21:22:46 +0000 (16:22 -0500)
commit175b2a6e4be06422da59d3a82c28d9a0e738e282
tree109f343f1e5207c3c6a2fc4c339465f4a1e81dc6
parent418ba9e5d6849ef2e8512d8853628ce4bf37937a
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>
ui/vnc-jobs-async.c
ui/vnc-jobs.h
ui/vnc.c
ui/vnc.h