aboutsummaryrefslogtreecommitdiff
path: root/balloon.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-03-09 17:00:02 +0800
committerEric Blake <eblake@redhat.com>2018-03-19 14:58:37 -0500
commitabe3cd0ff7f774966da6842620806ab7576fe4f3 (patch)
tree83b425f25ddd08879736a6a9a45a605a1d10b9f3 /balloon.c
parentcf869d53172920536a14180a83292b240e9d0545 (diff)
qmp: isolate responses into io thread
For those monitors who have enabled IO thread, we'll offload the responding procedure into IO thread. The main reason is that chardev is not thread safe, and we need to do all the read/write IOs in the same thread. For use_io_thr=true monitors, that thread is the IO thread. We do this isolation in similar pattern as what we have done to the request queue: we first create one response queue for each monitor, then instead of replying directly in the main thread, we queue the responses and kick the IO thread to do the rest of the job for us. A funny thing after doing this is that, when the QMP clients send "quit" to QEMU, it's possible that we close the IOThread even earlier than replying to that "quit". So another thing we need to do before cleaning up the monitors is that we need to flush the response queue (we don't need to do that for command queue; after all we are quitting) to make sure replies for handled commands are always flushed back to clients. Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-20-peterx@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'balloon.c')
0 files changed, 0 insertions, 0 deletions