From: Peter Xu <peterx@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v3 1/1] vl/s390x: fixup ram sizes for compat machines
Date: Thu, 2 Apr 2020 13:48:30 -0400 [thread overview]
Message-ID: <20200402174830.GC103677@xz-x1> (raw)
In-Reply-To: <20200402170123.2e132d0a@redhat.com>
On Thu, Apr 02, 2020 at 05:01:23PM +0200, Igor Mammedov wrote:
> On Thu, 2 Apr 2020 14:35:21 +0200
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>
> > On 02.04.20 14:09, Christian Borntraeger wrote:
> > >
> > >
> > > On 02.04.20 14:05, Igor Mammedov wrote:
> > >> On Thu, 2 Apr 2020 13:42:22 +0200
> > >> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> > >>
> > >>> On 02.04.20 13:39, Igor Mammedov wrote:
> > >>> [...]
> > >>>>>>
> > >>>>>>> + "MB to match machine restrictions. Consider updating "
> > >>>>>>> + "the guest definition.i\n", sz / MiB, newsz / MiB);
> > >>>>>>
> > >>>>>> also it might be better to use size_to_str() to format numbers
> > >>>>>
> > >>>>> The text explicitly talks about 'MB'... not sure if it would be
> > >>>>> confusing if the user specified MB and ended up with GB or so in this
> > >>>>> message.
> > >>>>
> > >>>> MB can be dropped, since it still might not match what user specified with -m
> > >>>> it could be specified in b/kb/mb/gb over there
> > >>>>
> > >>>> so I'd drop MB and print value size_to_str() returns
> > >>>> (it will add appropriate suffix if I'm not mistaken)
> > >
> > > Another thing: size_to_str is also do rounding (whenever the integer part is >1000).
> > > Doesnt this result in potential messages where both numbers are the same?
> >
> > For example
> >
> > 10241263616-> 9.54 GiB
> > 10241262592-> 9.54 GiB
>
> doesn't seem to be working as one would expect (and it's used in number of places now)
> CCing original author of it
That looks sane to me. Gib is IEC binary unit as explained by the
comment of the function, and the function prints with %0.3g so that we
keep three digits. IIUC that's ideal when we want to display
something like disk image sizes, but for sure it won't satisfy any
formatting of digits. Maybe add a new helper?
Thanks,
>
> > The only guaranteed way to actually see a difference is to use MB.
> >
> >
>
--
Peter Xu
next prev parent reply other threads:[~2020-04-02 17:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 12:37 [PATCH v3 1/1] vl/s390x: fixup ram sizes for compat machines Christian Borntraeger
2020-04-01 12:46 ` Christian Borntraeger
2020-04-01 13:14 ` David Hildenbrand
2020-04-02 9:22 ` Cornelia Huck
2020-04-02 9:25 ` Christian Borntraeger
2020-04-02 10:27 ` Cornelia Huck
2020-04-02 10:32 ` Christian Borntraeger
2020-04-01 16:34 ` Igor Mammedov
2020-04-02 9:27 ` Cornelia Huck
2020-04-02 9:39 ` Christian Borntraeger
2020-04-02 9:43 ` Cornelia Huck
2020-04-02 11:25 ` Cornelia Huck
2020-04-02 11:32 ` Christian Borntraeger
2020-04-02 11:39 ` Igor Mammedov
2020-04-02 11:42 ` Christian Borntraeger
2020-04-02 12:05 ` Igor Mammedov
2020-04-02 12:09 ` Christian Borntraeger
2020-04-02 12:35 ` Christian Borntraeger
2020-04-02 14:18 ` Cornelia Huck
2020-04-02 15:01 ` Igor Mammedov
2020-04-02 17:48 ` Peter Xu [this message]
2020-04-02 15:16 ` Cornelia Huck
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=20200402174830.GC103677@xz-x1 \
--to=peterx@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).