[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v5 21/26] qmp: isolate responses into io thread
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC v5 21/26] qmp: isolate responses into io thread |
Date: |
Thu, 14 Dec 2017 13:43:59 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Dec 05, 2017 at 01:51:55PM +0800, Peter Xu wrote:
> @@ -4429,6 +4515,13 @@ void monitor_cleanup(void)
> */
> iothread_stop(mon_global.mon_iothread);
>
> + /*
> + * After we have IOThread to send responses, it's possible that
> + * when we stop the IOThread there are still replies queued in the
> + * responder queue. Flush all of them.
> + */
> + monitor_qmp_bh_responder(NULL);
This doesn't work because monitor_qmp_bh_responder() does not guarantee
that the full response has been written when it returns.
When qemu_chr_fe_write() returns EAGAIN then qemu_chr_fe_add_watch() is
used to register an event loop callback when the chardev becomes
writable again. But you stopped the event loop using iothread_stop() so
we will never complete the write.
I suggest draining the monitor while the IOThread is still running
(that way the AioContext and GMainContext are still operational). You
can:
1. Suspend the monitor so new commands will not be read.
2. Wait until all responses and outbuf are empty.
Another option is moving the chardev back to the main loop but I'm not
sure if the chardev subsystem supports that.
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [RFC v5 18/26] monitor: send event when request queue full, (continued)
[Qemu-devel] [RFC v5 19/26] qapi: introduce new cmd option "allow-oob", Peter Xu, 2017/12/05
[Qemu-devel] [RFC v5 20/26] qmp: support out-of-band (oob) execution, Peter Xu, 2017/12/05
[Qemu-devel] [RFC v5 21/26] qmp: isolate responses into io thread, Peter Xu, 2017/12/05
- Re: [Qemu-devel] [RFC v5 21/26] qmp: isolate responses into io thread,
Stefan Hajnoczi <=
[Qemu-devel] [RFC v5 22/26] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2017/12/05
[Qemu-devel] [RFC v5 23/26] qmp: add command "x-oob-test", Peter Xu, 2017/12/05
[Qemu-devel] [RFC v5 24/26] docs: update QMP documents for OOB commands, Peter Xu, 2017/12/05