[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 2/8] curl: strengthen assertion in curl_clean_state
From: |
Jeff Cody |
Subject: |
[Qemu-block] [PULL 2/8] curl: strengthen assertion in curl_clean_state |
Date: |
Tue, 16 May 2017 11:54:14 -0400 |
From: Paolo Bonzini <address@hidden>
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: address@hidden
Reviewed-by: Jeff Cody <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>
---
block/curl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/curl.c b/block/curl.c
index 4382234..562340f 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -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);
--
2.9.3
- [Qemu-block] [PULL 0/8] Block patches for curl, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 2/8] curl: strengthen assertion in curl_clean_state,
Jeff Cody <=
- [Qemu-block] [PULL 1/8] block: curl: Allow passing cookies via QCryptoSecret, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 3/8] curl: never invoke callbacks with s->mutex held, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 7/8] curl: convert readv to coroutines, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 5/8] curl: split curl_find_state/curl_init_state, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 4/8] curl: avoid recursive locking of BDRVCURLState mutex, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 6/8] curl: convert CURLAIOCB to byte values, Jeff Cody, 2017/05/16
- [Qemu-block] [PULL 8/8] curl: do not do aio_poll when waiting for a free CURLState, Jeff Cody, 2017/05/16
- Re: [Qemu-block] [PULL 0/8] Block patches for curl, Stefan Hajnoczi, 2017/05/17