diff options
author | Peter Xu <peterx@redhat.com> | 2018-03-26 14:38:55 +0800 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-03-27 10:17:45 -0500 |
commit | 6d2d563f8ccc20a08a60ac87513ac113e0c881e3 (patch) | |
tree | d0db60eff2d72789874b2a76fbd5558d8f194f01 /include/monitor/monitor.h | |
parent | 1a1b11dc0fb519f6dbc420925bde032e772fd610 (diff) |
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 <marcandre.lureau@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180326063901.27425-3-peterx@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[eblake: drop pointless qmp_response_free(), drop queue flush on connect
since a clean queue on disconnect is sufficient]
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/monitor/monitor.h')
0 files changed, 0 insertions, 0 deletions