On 4/1/19 9:21 AM, Kevin Wolf wrote: > Am 30.03.2019 um 16:07 hat Eric Blake geschrieben: >> Disk sizes close to INT64_MAX cause overflow, for some pretty >> ridiculous output: >> >> $ ./nbdkit -U - memory size=$((2**63 - 512)) --run 'qemu-img info $nbd' >> image: nbd+unix://?socket=/tmp/nbdkitHSAzNz/socket >> file format: raw >> virtual size: -8388607T (9223372036854775296 bytes) >> disk size: unavailable >> >> But there's no reason to have two separate implementations of integer >> to human-readable abbreviation, where one has overflow and stops at >> 'T', while the other avoids overflow and goes all the way to 'E'. With >> this patch, the output now claims 8EiB instead of -8388607T, which >> really is the correct rounding of largest file size supported by qemu >> (we could go 511 bytes larger if we used byte-accurate sizing instead >> of rounding up to the next sector boundary, but that wouldn't change >> the human-readable result). >> >> Reported-by: Richard W.M. Jones <rjo...@redhat.com> >> Signed-off-by: Eric Blake <ebl...@redhat.com> > > Thanks, applied to the block-next branch for 4.1.
You'll need v2. Coming up shortly. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature