[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 5/7] curl: convert CURLAIOCB to byt
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 5/7] curl: convert CURLAIOCB to byte values |
Date: |
Wed, 10 May 2017 19:36:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 10.05.2017 16:32, Paolo Bonzini wrote:
> This is in preparation for the conversion from bdrv_aio_readv to
> bdrv_co_preadv, and it also requires changing some of the size_t values
> to uint64_t. This was broken before for disks > 2TB, but now it would
> break at 4GB.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block/curl.c | 44 ++++++++++++++++++++++----------------------
> 1 file changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/block/curl.c b/block/curl.c
> index 4b4d5a2389..3e288f2bc7 100644
> --- a/block/curl.c
> +++ b/block/curl.c
[...]
> @@ -788,7 +788,7 @@ static int curl_open(BlockDriverState *bs, QDict
> *options, int flags,
> }
> #endif
>
> - s->len = (size_t)d;
> + s->len = d;
On a very personal level, I'd rather have an explicit cast when
converting floating point values to integers. Anyway:
Reviewed-by: Max Reitz <address@hidden>
On a very surprised level: Why does curl return the content length as a
double?! I can't think of a reason where that might be a good idea. If
your integer no longer fits into a uin64_t, the double will be inexact,
so it pretty much is useless, too...
>
> if ((!strncasecmp(s->url, "http://", strlen("http://"))
> || !strncasecmp(s->url, "https://", strlen("https://")))
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [Qemu-block] [PATCH 2/7] curl: never invoke callbacks with s->mutex held, (continued)
- [Qemu-devel] [PATCH 4/7] curl: split curl_find_state/curl_init_state, Paolo Bonzini, 2017/05/10
- [Qemu-devel] [PATCH 7/7] curl: do not do aio_poll when waiting for a free CURLState, Paolo Bonzini, 2017/05/10
- [Qemu-devel] [PATCH 5/7] curl: convert CURLAIOCB to byte values, Paolo Bonzini, 2017/05/10
- [Qemu-devel] [PATCH 6/7] curl: convert readv to coroutines, Paolo Bonzini, 2017/05/10
- Re: [Qemu-devel] [PATCH v2 0/7] curl: locking cleanups/fixes, coroutine conversion, remove aio_poll, no-reply, 2017/05/10
- Re: [Qemu-devel] [PATCH v2 0/7] curl: locking cleanups/fixes, coroutine conversion, remove aio_poll, Richard W.M. Jones, 2017/05/10