Skip to content

Commit

Permalink
curl: strengthen assertion in curl_clean_state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and codyprime committed May 16, 2017
1 parent 327c8eb commit 675a775
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block/curl.c
Expand Up @@ -533,6 +533,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);

Expand Down

0 comments on commit 675a775

Please sign in to comment.