Message ID | 20231006123910.17759-10-farosas@suse.de |
---|---|
State | New |
Headers | show |
Series | tests/migration-test: Allow testing older machine types | expand |
Fabiano Rosas <farosas@suse.de> wrote: > Now that we can query more than one binary, the "starting QEMU..." > message can get a little noisy. Mute those messages unless we're > running with --verbose. > > Only affects qtest_init() calls from within libqtest. The tests > continue to output as usual. > > Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
On 06/10/2023 14.39, Fabiano Rosas wrote: > Now that we can query more than one binary, the "starting QEMU..." > message can get a little noisy. Mute those messages unless we're > running with --verbose. > > Only affects qtest_init() calls from within libqtest. The tests > continue to output as usual. > > Signed-off-by: Fabiano Rosas <farosas@suse.de> > --- > tests/qtest/libqtest.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Thomas Huth <thuth@redhat.com>
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index f2f1756de1..ea844ad7bc 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -91,6 +91,7 @@ struct QTestState static GHookList abrt_hooks; static void (*sighandler_old)(int); +static bool silence_spawn_log; static int qtest_query_target_endianness(QTestState *s); @@ -405,7 +406,9 @@ static QTestState *G_GNUC_PRINTF(2, 3) qtest_spawn_qemu(const char *qemu_bin, qtest_add_abrt_handler(kill_qemu_hook_func, s); - g_test_message("starting QEMU: %s", command->str); + if (!silence_spawn_log) { + g_test_message("starting QEMU: %s", command->str); + } #ifndef _WIN32 s->qemu_pid = fork(); @@ -1465,6 +1468,8 @@ static struct MachInfo *qtest_get_machines(const char *var) return machines; } + silence_spawn_log = !g_test_verbose(); + qts = qtest_init_with_env(qemu_var, "-machine none"); response = qtest_qmp(qts, "{ 'execute': 'query-machines' }"); g_assert(response); @@ -1496,6 +1501,8 @@ static struct MachInfo *qtest_get_machines(const char *var) qtest_quit(qts); qobject_unref(response); + silence_spawn_log = false; + memset(&machines[idx], 0, sizeof(struct MachInfo)); /* Terminating entry */ return machines; }
Now that we can query more than one binary, the "starting QEMU..." message can get a little noisy. Mute those messages unless we're running with --verbose. Only affects qtest_init() calls from within libqtest. The tests continue to output as usual. Signed-off-by: Fabiano Rosas <farosas@suse.de> --- tests/qtest/libqtest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)