From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: will@kernel.org, julien.thierry.kdev@gmail.com,
andre.przywara@arm.com, maz@kernel.org, oliver.upton@linux.dev,
jean-philippe.brucker@arm.com, apatel@ventanamicro.com,
kvm@vger.kernel.org
Subject: Re: [PATCH kvmtool v2 2/4] Replace printf/fprintf with pr_* macros
Date: Fri, 14 Jul 2023 14:44:12 +0100 [thread overview]
Message-ID: <ZLFQZ5v3XX_NNTJd@monolith.localdoman> (raw)
In-Reply-To: <8097c572-6f40-fc11-361f-8e6e0c16ddff@arm.com>
Hi Suzuki,
On Wed, Jul 12, 2023 at 05:26:24PM +0100, Suzuki K Poulose wrote:
> Hi Alexandru
>
> On 07/07/2023 16:11, Alexandru Elisei wrote:
> > To prepare for allowing finer control over the messages that kvmtool
> > displays, replace printf() and fprintf() with the pr_* macros.
> >
> > Minor changes were made to fix coding style issues that were pet peeves for
> > the author. And use pr_err() in kvm_cpu__init() instead of pr_warning() for
> > fatal errors.
> >
> > Also, fix the message when printing the exit code for KVM_EXIT_UNKNOWN by
> > removing the '0x' part, because it's printing a decimal number, not a
> > hexadecimal one (the format specifier is %llu, not %llx).
> >
> > Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> > ---
> > Changelog:
> >
> > - Use pr_err() to directly replace fprintf() in kernel_usage_with_options()
> > instead of concatening the kernel locations.
> > - Removed the '0x' from the "KVM exit code: 0x%llu" message in kvm_cpu_thread()
> > because the number is decimal (it's %llu, not %llx).
> > - Reverted the changes to kvm__emulate_mmio() and debug_io () because those
> > messages are displayed with --debug-mmio, respectively --debug-ioport, and
> > --loglevel hiding them would have been counter-intuitive.
> > - Replaced the "warning" string in kvm__emulate_mmio() with "MMIO warning", to
> > match the message from kvm__emulate_io(). And to make it clear that it isn't
> > toggled with --loglevel.
> > - Removed extra spaces in virtio_compat_add_message().
> >
> > arm/gic.c | 5 ++---
> > builtin-run.c | 37 +++++++++++++++++++------------------
> > builtin-setup.c | 16 ++++++++--------
> > guest_compat.c | 2 +-
> > kvm-cpu.c | 12 ++++++------
> > mmio.c | 2 +-
> > 6 files changed, 37 insertions(+), 37 deletions(-)
> >
>
> > diff --git a/guest_compat.c b/guest_compat.c
> > index fd4704b20b16..93f9aabcd6db 100644
> > --- a/guest_compat.c
> > +++ b/guest_compat.c
> > @@ -86,7 +86,7 @@ int compat__print_all_messages(void)
> > msg = list_first_entry(&messages, struct compat_message, list);
> > - printf("\n # KVM compatibility warning.\n\t%s\n\t%s\n",
> > + pr_warning("KVM compatibility warning.\n\t%s\n\t%s",
> > msg->title, msg->desc);
>
> Does this really need to be a Warning ? A user could be running a non-
> Linux guest and reporting the compatibility with WARNING level makes it
> a bit tricky to suppress. i.e., User may want to suppress the "virtio"
> compatibility messages, without actually loosing any other important
> "Warnings". With the --loglevel=warning, we don't have that capability.
That sounds reasonable.
>
> There are two options here as far as I can see:
>
> 1) Convert compatibility messages to "Info"
> 2) Control the compatibility messages via new option, (something like we
> did here, with --nocompat [0])
Out of the two, I would rather go the "info" route, so there aren't two
separate methods to disable kvmtool messages, via --loglevel and via
--nocompat.
I'll prepare a patch.
Thanks,
Alex
>
> [0]
> https://lore.kernel.org/all/20230127113932.166089-5-suzuki.poulose@arm.com/
>
>
> Suzuki
>
next prev parent reply other threads:[~2023-07-14 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 15:11 [PATCH kvmtool v2 0/4] Add --loglevel argument Alexandru Elisei
2023-07-07 15:11 ` [PATCH kvmtool v2 1/4] util: Make pr_err() return void Alexandru Elisei
2023-07-07 15:11 ` [PATCH kvmtool v2 2/4] Replace printf/fprintf with pr_* macros Alexandru Elisei
2023-07-10 8:30 ` Jean-Philippe Brucker
2023-07-12 16:26 ` Suzuki K Poulose
2023-07-14 13:44 ` Alexandru Elisei [this message]
2023-07-07 15:11 ` [PATCH kvmtool v2 3/4] util: Use __pr_debug() instead of pr_info() to print debug messages Alexandru Elisei
2023-07-07 15:11 ` [PATCH kvmtool v2 4/4] Add --loglevel argument for the run command Alexandru Elisei
2023-07-10 6:56 ` [PATCH kvmtool v2 0/4] Add --loglevel argument Anup Patel
2023-07-12 16:17 ` Will Deacon
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=ZLFQZ5v3XX_NNTJd@monolith.localdoman \
--to=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=apatel@ventanamicro.com \
--cc=jean-philippe.brucker@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.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