summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-03-26 14:38:55 +0800
committerEric Blake <eblake@redhat.com>2018-03-27 10:17:45 -0500
commit6d2d563f8ccc20a08a60ac87513ac113e0c881e3 (patch)
treed0db60eff2d72789874b2a76fbd5558d8f194f01 /vl.c
parent1a1b11dc0fb519f6dbc420925bde032e772fd610 (diff)
downloadqemu-6d2d563f8ccc20a08a60ac87513ac113e0c881e3.tar.gz
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 'vl.c')
0 files changed, 0 insertions, 0 deletions