From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
vsementsov@virtuozzo.com, qemu-block@nongnu.org,
rjones@redhat.com, Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qemu-img: Saner printing of large file sizes
Date: Mon, 1 Apr 2019 14:16:41 +0100 [thread overview]
Message-ID: <20190401131641.GJ3524@redhat.com> (raw)
In-Reply-To: <20190401130416.GC4935@localhost.localdomain>
On Mon, Apr 01, 2019 at 03:04:16PM +0200, 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 <rjones@redhat.com>
> > Signed-off-by: Eric Blake <eblake@redhat.com>
>
> This is quite obviously a bug fix for some cases. This suggests that we
> want it in 4.0.
>
> It is also an output change for other cases, like going from "8M" to
> "8 MiB". We probably can't tell for sure whether some tools expect the
> spelling "8M" (even if this is supposed to be the human interface and
> tools should be using JSON) or feed the change back to qemu-img or
> qemu-io (which accept "8M", but not "8 MiB" as sizes in most places).
> This suggests that we shouldn't make this change as late as -rc2.
If it breaks our own tests, then it is possible to break other tools
too.
> So what is the conclusion?
The safe option is to do the minimal fix for the existing code and look at
the refactoring in the next dev cycle.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-04-01 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190330150702.11687-1-eblake@redhat.com>
2019-04-01 12:18 ` [Qemu-devel] [PATCH] qemu-img: Saner printing of large file sizes Vladimir Sementsov-Ogievskiy
2019-04-01 13:04 ` Kevin Wolf
2019-04-01 13:16 ` Daniel P. Berrangé [this message]
2019-04-01 13:22 ` Eric Blake
2019-04-01 14:21 ` Kevin Wolf
2019-04-01 14:55 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190401131641.GJ3524@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.