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 <stefa...@redhat.com>
Signed-off-by: Peter Xu <pet...@redhat.com>
---
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 <ebl...@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org