[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230127113932.166089-5-suzuki.poulose@arm.com>
Date: Fri, 27 Jan 2023 11:39:05 +0000
From: Suzuki K Poulose <suzuki.poulose@....com>
To: kvm@...r.kernel.org, kvmarm@...ts.linux.dev
Cc: suzuki.poulose@....com,
Alexandru Elisei <alexandru.elisei@....com>,
Andrew Jones <andrew.jones@...ux.dev>,
Christoffer Dall <christoffer.dall@....com>,
Fuad Tabba <tabba@...gle.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Joey Gouly <Joey.Gouly@....com>, Marc Zyngier <maz@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Paolo Bonzini <pbonzini@...hat.com>,
Quentin Perret <qperret@...gle.com>,
Steven Price <steven.price@....com>,
Thomas Huth <thuth@...hat.com>, Will Deacon <will@...nel.org>,
Zenghui Yu <yuzenghui@...wei.com>, linux-coco@...ts.linux.dev,
kvmarm@...ts.cs.columbia.edu, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [RFC kvmtool 04/31] Add --nocompat option to disable compat warnings
From: Alexandru Elisei <alexandru.elisei@....com>
Commit e66942073035 ("kvm tools: Guest kernel compatability") added the
functionality that enables devices to print a warning message if the device
hasn't been initialized by the time the VM is destroyed. The purpose of
these messages is to let the user know if the kernel hasn't been built with
the correct Kconfig options to take advantage of the said devices (all
using virtio).
Since then, kvmtool has evolved and now supports loading different payloads
(like firmware images), and having those warnings even when it is entirely
intentional for the payload not to touch the devices can be confusing for
the user and makes the output unnecessarily verbose in those cases.
Add the --nocompat option to disable the warnings; the warnings are still
enabled by default.
Reported-by: Christoffer Dall <christoffer.dall@....com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@....com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
---
builtin-run.c | 5 ++++-
guest_compat.c | 1 +
include/kvm/kvm-config.h | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtin-run.c b/builtin-run.c
index bb7e6e8d..f8edfb3f 100644
--- a/builtin-run.c
+++ b/builtin-run.c
@@ -183,6 +183,8 @@ static int mem_parser(const struct option *opt, const char *arg, int unset)
OPT_BOOLEAN('\0', "nodefaults", &(cfg)->nodefaults, "Disable" \
" implicit configuration that cannot be" \
" disabled otherwise"), \
+ OPT_BOOLEAN('\0', "nocompat", &(cfg)->nocompat, "Disable" \
+ " compat warnings"), \
OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", \
"Enable virtio 9p to share files between host and" \
" guest", virtio_9p_rootdir_parser, kvm), \
@@ -797,7 +799,8 @@ static int kvm_cmd_run_work(struct kvm *kvm)
static void kvm_cmd_run_exit(struct kvm *kvm, int guest_ret)
{
- compat__print_all_messages();
+ if (!kvm->cfg.nocompat)
+ compat__print_all_messages();
init_list__exit(kvm);
diff --git a/guest_compat.c b/guest_compat.c
index fd4704b2..a413c12c 100644
--- a/guest_compat.c
+++ b/guest_compat.c
@@ -88,6 +88,7 @@ int compat__print_all_messages(void)
printf("\n # KVM compatibility warning.\n\t%s\n\t%s\n",
msg->title, msg->desc);
+ printf("\tTo stop seeing this warning, use the --nocompat option.\n");
list_del(&msg->list);
compat__free(msg);
diff --git a/include/kvm/kvm-config.h b/include/kvm/kvm-config.h
index 368e6c7d..88df7cc2 100644
--- a/include/kvm/kvm-config.h
+++ b/include/kvm/kvm-config.h
@@ -30,6 +30,7 @@ struct kvm_config {
u64 vsock_cid;
bool virtio_rng;
bool nodefaults;
+ bool nocompat;
int active_console;
int debug_iodelay;
int nrcpus;
--
2.34.1
Powered by blists - more mailing lists