aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-05-15 12:00:53 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-08-03 14:32:46 -0500
commitf00c08cbac63f452cc0828f60345a62cc175daa2 (patch)
treedd1c96dfc080e36bcc1d35447285ddcd0e5a0dc3 /block
parentd81db0becaeca093a55f3dba110c55528ad5c3bc (diff)
downloadqemu-f00c08cbac63f452cc0828f60345a62cc175daa2.zip
qemu-f00c08cbac63f452cc0828f60345a62cc175daa2.tar.gz
qemu-f00c08cbac63f452cc0828f60345a62cc175daa2.tar.bz2
curl: strengthen assertion in curl_clean_state
curl_clean_state should only be called after all AIOCBs have been completed. This is not so obvious for the call from curl_detach_aio_context, so assert that. Cc: qemu-stable@nongnu.org Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170515100059.15795-2-pbonzini@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com> (cherry picked from commit 675a775633e68bf8b426a896fea5b93a4f4ff1cc) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/curl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/curl.c b/block/curl.c
index aa6e8cc..c6dc4c0 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -532,6 +532,11 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s)
static void curl_clean_state(CURLState *s)
{
+ int j;
+ for (j = 0; j < CURL_NUM_ACB; j++) {
+ assert(!s->acb[j]);
+ }
+
if (s->s->multi)
curl_multi_remove_handle(s->s->multi, s->curl);