From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com,
Mark Kanda <mark.kanda@oracle.com>
Subject: Re: [PATCH v5 06/10] hmp: add basic "info stats" implementation
Date: Wed, 8 Jun 2022 16:23:55 +0100 [thread overview]
Message-ID: <YqC/C0JnLwiZ2OOk@work-vm> (raw)
In-Reply-To: <97f0df53-73fa-0ddb-d6df-088a41fb5588@redhat.com>
* Paolo Bonzini (pbonzini@redhat.com) wrote:
> On 6/7/22 20:35, Dr. David Alan Gilbert wrote:
> > > + monitor_printf(mon, "%s", iec_binary_prefix(value->exponent));
> > OK that's better; but it's a shame the limits don't come from something
> > shared; iec_binary_prefix goes upto 60 and si_prefix goes way below -9
> >
> > Reviewed-by: Dr. David Alan Gilbert<dgilbert@redhat.com>
> >
>
> I can remove the limits altogether, and consider it a bug of the provider if
> they're not respected, but it's a bit ugly to have an assertion failure in
> that case.
[I just noticed si_prefix is declared to take 'unsigned int' which is
probably wrong)
Why don't you change the si_prefix/iec_binary_prefix to return NULL
rather than asserting, then we end up with something like:
exponentstr = NULL;
if (unit && value->base == 10) {
exponentstr = si_prefix(value->exponent);
} else if (unit && value->base == 2) {
exponentstr = iec_binary_prefix(value->exponent);
}
if (exponentstr) {
monitor_printf(mon, "%s", exponentstr);
} else if (value->exponent) {
Dave
> Paolo
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2022-06-08 15:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-30 15:07 [PATCH v5 00/10] qmp, hmp: statistics subsystem and KVM suport Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 01/10] qmp: Support for querying stats Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 02/10] kvm: Support for querying fd-based stats Paolo Bonzini
2022-06-07 17:44 ` Dr. David Alan Gilbert
2022-06-08 14:13 ` Paolo Bonzini
2022-06-08 14:52 ` Dr. David Alan Gilbert
2022-06-08 15:58 ` Paolo Bonzini
2022-06-08 16:01 ` Dr. David Alan Gilbert
2022-06-08 16:10 ` Paolo Bonzini
2022-06-08 16:17 ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 03/10] qmp: add filtering of statistics by target vCPU Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 04/10] cutils: fix case for "kilo" and "kibi" Paolo Bonzini
2022-05-30 21:56 ` Philippe Mathieu-Daudé via
2022-05-30 15:07 ` [PATCH v5 05/10] cutils: add functions for IEC and SI prefixes Paolo Bonzini
2022-05-30 21:59 ` Philippe Mathieu-Daudé via
2022-05-31 10:28 ` Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 06/10] hmp: add basic "info stats" implementation Paolo Bonzini
2022-06-07 18:35 ` Dr. David Alan Gilbert
2022-06-08 14:27 ` Paolo Bonzini
2022-06-08 15:23 ` Dr. David Alan Gilbert [this message]
2022-05-30 15:07 ` [PATCH v5 07/10] qmp: add filtering of statistics by provider Paolo Bonzini
2022-06-08 11:52 ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 08/10] hmp: " Paolo Bonzini
2022-06-08 12:06 ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 09/10] qmp: add filtering of statistics by name Paolo Bonzini
2022-06-08 13:36 ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 10/10] hmp: " Paolo Bonzini
2022-06-08 13:40 ` Dr. David Alan Gilbert
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=YqC/C0JnLwiZ2OOk@work-vm \
--to=dgilbert@redhat.com \
--cc=armbru@redhat.com \
--cc=mark.kanda@oracle.com \
--cc=pbonzini@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 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.