[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/23] softmmu/vl: Be less verbose about missing KVM when running
From: |
Thomas Huth |
Subject: |
[PULL 08/23] softmmu/vl: Be less verbose about missing KVM when running the qtests |
Date: |
Tue, 13 Oct 2020 12:55:12 +0200 |
Some of the qtests use "-accel kvm -accel tcg" to run real guest code.
This causes some error messages when kvm is not available. We do not
really care about these messages since the fallback to tcg is expected
here. So let's silence them to avoid that they spoil the output of
the tests.
Unfortunately, we can not use the qtest_enabled() wrapper in this case,
since the qtest accelerator itself is not initialized. Thus we have to
test for the qtest_chrdev variable instead.
Message-Id: <20200710085020.28222-1-thuth@redhat.com>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
softmmu/vl.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 5a11a62f78..254ee5e525 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -165,8 +165,9 @@ bool boot_strict;
uint8_t *boot_splash_filedata;
int only_migratable; /* turn it off unless user states otherwise */
bool wakeup_suspend_enabled;
-
int icount_align_option;
+static const char *qtest_chrdev;
+static const char *qtest_log;
/* The bytes in qemu_uuid are in the order specified by RFC4122, _not_ in the
* little-endian "wire format" described in the SMBIOS 2.6 specification.
@@ -2713,10 +2714,15 @@ static int do_configure_accelerator(void *opaque,
QemuOpts *opts, Error **errp)
AccelClass *ac = accel_find(acc);
AccelState *accel;
int ret;
+ bool qtest_with_kvm;
+
+ qtest_with_kvm = g_str_equal(acc, "kvm") && qtest_chrdev != NULL;
if (!ac) {
*p_init_failed = true;
- error_report("invalid accelerator %s", acc);
+ if (!qtest_with_kvm) {
+ error_report("invalid accelerator %s", acc);
+ }
return 0;
}
accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac)));
@@ -2728,8 +2734,9 @@ static int do_configure_accelerator(void *opaque,
QemuOpts *opts, Error **errp)
ret = accel_init_machine(accel, current_machine);
if (ret < 0) {
*p_init_failed = true;
- error_report("failed to initialize %s: %s",
- acc, strerror(-ret));
+ if (!qtest_with_kvm || ret != -ENOENT) {
+ error_report("failed to initialize %s: %s", acc, strerror(-ret));
+ }
return 0;
}
@@ -2800,7 +2807,7 @@ static void configure_accelerators(const char *progname)
exit(1);
}
- if (init_failed) {
+ if (init_failed && !qtest_chrdev) {
AccelClass *ac = ACCEL_GET_CLASS(current_accel());
error_report("falling back to %s", ac->name);
}
@@ -2870,8 +2877,6 @@ void qemu_init(int argc, char **argv, char **envp)
MachineClass *machine_class;
const char *cpu_option;
const char *vga_model = NULL;
- const char *qtest_chrdev = NULL;
- const char *qtest_log = NULL;
const char *incoming = NULL;
bool userconfig = true;
bool nographic = false;
--
2.18.2
- [PULL 00/23] qtests, gitlab-CI and misc patches, Thomas Huth, 2020/10/13
- [PULL 01/23] tests/qtest: Replace magic value by NANOSECONDS_PER_SECOND definition, Thomas Huth, 2020/10/13
- [PULL 02/23] gitlab-ci.yml: Only run one test-case per fuzzer, Thomas Huth, 2020/10/13
- [PULL 03/23] Acceptance tests: bump pycdlib version for easier installation, Thomas Huth, 2020/10/13
- [PULL 04/23] Acceptance tests: do not show canceled test logs on GitLab CI, Thomas Huth, 2020/10/13
- [PULL 05/23] Acceptance tests: show test report on GitLab CI, Thomas Huth, 2020/10/13
- [PULL 06/23] qtest: add fuzz test case, Thomas Huth, 2020/10/13
- [PULL 08/23] softmmu/vl: Be less verbose about missing KVM when running the qtests,
Thomas Huth <=
- [PULL 13/23] configure: fixes indent of $meson setup, Thomas Huth, 2020/10/13
- [PULL 12/23] docs/system/deprecated: Mark the 'moxie' CPU as deprecated, Thomas Huth, 2020/10/13
- [PULL 09/23] Add a comment in bios-tables-test.c to clarify the reason behind approach, Thomas Huth, 2020/10/13
- [PULL 10/23] MAINTAINERS: Ignore bios-tables-test in the qtest section, Thomas Huth, 2020/10/13
- [PULL 11/23] Remove superfluous .gitignore files, Thomas Huth, 2020/10/13
- [PULL 15/23] gitlab: add a CI job to validate the DCO sign off, Thomas Huth, 2020/10/13
- [PULL 07/23] tests/migration: Allow longer timeouts, Thomas Huth, 2020/10/13
- [PULL 14/23] gitlab: add a CI job for running checkpatch.pl, Thomas Huth, 2020/10/13
- [PULL 16/23] gitlab: assign python helper files to GitLab maintainers section, Thomas Huth, 2020/10/13
- [PULL 18/23] scripts/ci/gitlab-pipeline-status: improve message regarding timeout, Thomas Huth, 2020/10/13