]> git.proxmox.com Git - mirror_qemu.git/commitdiff
curl: strengthen assertion in curl_clean_state
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 May 2017 10:00:53 +0000 (12:00 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Aug 2017 19:32:46 +0000 (14:32 -0500)
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>
block/curl.c

index aa6e8cc0e5913738957539efd3ac0378a1c80bb7..c6dc4c09fd39a5f3596c72f4c1da42b40a01353a 100644 (file)
@@ -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);