]> git.ipfire.org Git - thirdparty/qemu.git/commit
monitor/qmp: resume monitor when clearing its queue
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 15 Nov 2019 08:59:14 +0000 (09:59 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 19 Nov 2019 07:21:47 +0000 (08:21 +0100)
commit2895aaa139b3f916b3650ca516b35dceb9c0d4c4
treee65267e31d5afee4b7b438e7cd43287e4984bd55
parenta5c2a235103ab366ad5318636ec138e52c6dcfa4
monitor/qmp: resume monitor when clearing its queue

When a monitor's queue is filled up in handle_qmp_command()
it gets suspended. It's the dispatcher bh's job currently to
resume the monitor, which it does after processing an event
from the queue. However, it is possible for a
CHR_EVENT_CLOSED event to be processed before before the bh
is scheduled, which will clear the queue without resuming
the monitor, thereby preventing the dispatcher from reaching
the resume() call.
Any new connections to the qmp socket will be accept()ed and
show the greeting, but will not respond to any messages sent
afterwards (as they will not be read from the
still-suspended socket).
Fix this by resuming the monitor when clearing a queue which
was filled up.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Message-Id: <20191115085914.21287-1-w.bumiller@proxmox.com>
monitor/qmp.c