[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispa
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher |
Date: |
Sat, 10 Mar 2018 20:00:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 03/09/2018 02:59 AM, Peter Xu wrote:
Originally QMP goes through these steps:
JSON Parser --> QMP Dispatcher --> Respond
/|\ (2) (3) |
(1) | \|/ (4)
+--------- main thread --------+
This patch does this:
JSON Parser QMP Dispatcher --> Respond
/|\ | /|\ (4) |
| | (2) | (3) | (5)
(1) | +-----> | \|/
+--------- main thread <-------+
So the parsing job and the dispatching job is isolated now. It gives us
a chance in following up patches to totally move the parser outside.
s/following/follow/
The isolation is done using one QEMUBH. Only one dispatcher QEMUBH is
used for all the monitors.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
---
monitor.c | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 178 insertions(+), 23 deletions(-)
if (trace_event_get_state_backends(TRACE_HANDLE_QMP_COMMAND)) {
QString *req_json = qobject_to_json(req);
More context conflicts.
+/*
+ * Pop one QMP request from monitor queues, return NULL if not found.
+ * We are using round-robin fashion to pop the request, to avoid
+ * processing command only on a very busy monitor. To achieve that,
s/command/commands/
+ * when we processed one request on specific monitor, we put that
s/processed/process/
s/on/on a/
+ * monitor to the end of mon_list queue.
+ */
+static QMPRequest *monitor_qmp_requests_pop_one(void)
+
+ /*
+ * If OOB is not enabled on current monitor, we'll emulate the old
+ * behavior that we won't process current monitor any more until
s/current/the current/g
+ * it is responded. This helps make sure that as long as OOB is
/is responded/has responded/
+ * not enabled, the server will never drop any command.
+ */
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [Qemu-devel] [PATCH v8 09/23] monitor: allow using IO thread for parsing, (continued)
- [Qemu-devel] [PATCH v8 09/23] monitor: allow using IO thread for parsing, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 10/23] qmp: introduce QMPCapability, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 11/23] monitor: introduce monitor_qmp_respond(), Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 12/23] monitor: let suspend_cnt be thread safe, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 13/23] monitor: let suspend/resume work even with QMPs, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Peter Xu, 2018/03/09
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Marc-André Lureau, 2018/03/21
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Dr. David Alan Gilbert, 2018/03/21
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Eric Blake, 2018/03/21
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Marc-André Lureau, 2018/03/21
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Peter Xu, 2018/03/22
- Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Eric Blake, 2018/03/22
Re: [Qemu-devel] [PATCH v8 14/23] monitor: separate QMP parser and dispatcher, Marc-André Lureau, 2018/03/23