]> git.proxmox.com Git - mirror_qemu.git/commit
monitor: do not use QTAILQ_FOREACH_SAFE across critical sections
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Dec 2018 13:40:41 +0000 (14:40 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Feb 2019 15:50:18 +0000 (16:50 +0100)
commit82e870bac441f231deb72b64c9baf2f2fbd5bdbb
tree222eef2927695d383133546f3ee2b4165ea263b5
parent1b9d35f33c85e63377b02eba276dd1bb102247f9
monitor: do not use QTAILQ_FOREACH_SAFE across critical sections

monitor_qmp_requests_pop_any_with_lock cannot modify the monitor list
concurrently with monitor_cleanup, since the dispatch bottom half
runs in the main thread, but anyway it is a bit ugly to keep
"next" live across critical sections of monitor_lock and Coverity
complains (CID 1397072).

Replace QTAILQ_FOREACH_SAFE with a while loop and QTAILQ_FIRST,
it is cleaner and more future-proof.

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