]> git.ipfire.org Git - thirdparty/qemu.git/commit
monitor: cleanup fetching of QMP requests
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 Mar 2023 11:51:33 +0000 (12:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 25 May 2023 08:18:33 +0000 (10:18 +0200)
commit0ff25537018c0939919a35886265c38db28b2a8a
tree3cc80836b6b28de353bffe206a05235a65e92737
parent3e6bed619a1d13858e540e01aae275abdf9146ae
monitor: cleanup fetching of QMP requests

Use a continue statement so that "after going to sleep" is treated the same
way as "after processing a request".  Pull the monitor_lock critical
section out of monitor_qmp_requests_pop_any_with_lock() and protect
qmp_dispatcher_co_shutdown with the monitor_lock.

The two changes are complex to separate because monitor_qmp_dispatcher_co()
previously had a complicated logic to check for shutdown both before
and after going to sleep.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
monitor/monitor.c
monitor/qmp.c