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 <pbonz...@redhat.com> > --- > 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 <mre...@redhat.com> 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