]> Git Repo - qemu.git/commit
qmp: cleanup qmp queues properly
authorPeter Xu <[email protected]>
Mon, 26 Mar 2018 06:38:55 +0000 (14:38 +0800)
committerEric Blake <[email protected]>
Tue, 27 Mar 2018 15:17:45 +0000 (10:17 -0500)
commit6d2d563f8ccc20a08a60ac87513ac113e0c881e3
treed0db60eff2d72789874b2a76fbd5558d8f194f01
parent1a1b11dc0fb519f6dbc420925bde032e772fd610
qmp: cleanup qmp queues properly

Marc-André Lureau reported that we can have this happen:

1. client1 connects, send command C1
2. client1 disconnects before getting response for C1
3. client2 connects, who might receive response of C1

However client2 should not receive remaining responses for client1.

Basically, we should clean up the request/response queue elements when:

- after a session is closed
- before destroying the queues

Some helpers are introduced to achieve that.  We need to make sure we're
with the lock when operating on those queues.  This also needed the
declaration of QMPRequest moved earlier.

Reported-by: Marc-André Lureau <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <20180326063901[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
[eblake: drop pointless qmp_response_free(), drop queue flush on connect
since a clean queue on disconnect is sufficient]
Tested-by: Christian Borntraeger <[email protected]>
Signed-off-by: Eric Blake <[email protected]>
monitor.c
This page took 0.025455 seconds and 4 git commands to generate.