All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] qemu-char/monitor: make monitor_puts thread safe
@ 2014-06-03 16:39 Paolo Bonzini
  2014-06-03 16:39 ` [Qemu-devel] [PATCH 1/6] qemu-char: introduce qemu_chr_alloc Paolo Bonzini
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Paolo Bonzini @ 2014-06-03 16:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, famz, kraxel, stefanha, lcapitulino

Even though virtio-blk-dataplane mostly synchronizes with the block layer
by means of the AioContext, we still need to introduce mutexes for other
QEMU subsystems that the dataplane thread might encounter on its way.
Adding rerror/werror support, for example, means that the dataplane
thread will have to generate QMP events.

monitor_puts is the entry point for generating QMP responses and events.
Making it thread-safe lets virtio-blk-dataplane threads generate QMP
events; because the same entry point is also used for responses, a
response and an event will never be intertwined.

Protection is inserted at both the qemu-char and monitor levels.
A generic mutex is necessary in qemu_fe_chr_write so that
qemu_chr_fe_write_all does not break its output; we reuse that
mutex in some of the character devices.

There is no need to protect against removal of the monitor's backend,
since the monitor itself cannot be removed.

Paolo Bonzini (6):
  qemu-char: introduce qemu_chr_alloc
  qemu-char: do not call chr_write directly
  qemu-char: move pty_chr_update_read_handler around
  qemu-char: make writes thread-safe
  monitor: protect outbuf with mutex
  monitor: protect event emission

 backends/baum.c       |   2 +-
 backends/msmouse.c    |   2 +-
 include/sysemu/char.h |  20 ++++++--
 monitor.c             |  55 ++++++++++++++++++----
 qemu-char.c           | 125 +++++++++++++++++++++++++++++++++-----------------
 spice-qemu-char.c     |   2 +-
 ui/console.c          |   2 +-
 7 files changed, 149 insertions(+), 59 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-06-27 12:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-03 16:39 [Qemu-devel] [PATCH 0/5] qemu-char/monitor: make monitor_puts thread safe Paolo Bonzini
2014-06-03 16:39 ` [Qemu-devel] [PATCH 1/6] qemu-char: introduce qemu_chr_alloc Paolo Bonzini
2014-06-11  6:28   ` Fam Zheng
2014-06-03 16:39 ` [Qemu-devel] [PATCH 2/6] qemu-char: do not call chr_write directly Paolo Bonzini
2014-06-11  6:30   ` Fam Zheng
2014-06-03 16:39 ` [Qemu-devel] [PATCH 3/6] qemu-char: move pty_chr_update_read_handler around Paolo Bonzini
2014-06-11  6:32   ` Fam Zheng
2014-06-03 16:39 ` [Qemu-devel] [PATCH 4/6] qemu-char: make writes thread-safe Paolo Bonzini
2014-06-11  6:59   ` Fam Zheng
2014-06-11  8:16     ` Paolo Bonzini
2014-06-03 16:39 ` [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex Paolo Bonzini
2014-06-10 14:10   ` Luiz Capitulino
2014-06-10 14:24     ` Paolo Bonzini
2014-06-10 14:28       ` Luiz Capitulino
2014-06-03 16:39 ` [Qemu-devel] [PATCH 6/6] monitor: protect event emission Paolo Bonzini
2014-06-10 13:33   ` Luiz Capitulino
2014-06-27  9:43 ` [Qemu-devel] [PATCH 0/5] qemu-char/monitor: make monitor_puts thread safe Stefan Hajnoczi
2014-06-27 12:33   ` Luiz Capitulino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.