From: Daniel P. Berrangé Date: Fri, 17 Mar 2023 17:05:53 +0000 (+0000) Subject: qtests: avoid printing comments before g_test_init() X-Git-Tag: v8.0.0-rc2~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e35b9a2e81ccce86db6f1417b1d73bb97d7cbc17;p=thirdparty%2Fqemu.git qtests: avoid printing comments before g_test_init() The TAP protocol version line must be the first thing printed on stdout. The migration test failed that requirement in certain scenarios: # Skipping test: Userfault not available (builtdtime) TAP version 13 # random seed: R02Sc120c807f11053eb90bfea845ba1e368 1..32 # Start of x86_64 tests # Start of migration tests .... The TAP version is printed by g_test_init(), so we need to make sure that any methods which print are run after that. Signed-off-by: Daniel P. Berrangé Reviewed-by: Peter Maydell Message-Id: <20230317170553.592707-1-berrange@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 75d4f1d4a98..3b615b0da99 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2462,14 +2462,18 @@ static bool kvm_dirty_ring_supported(void) int main(int argc, char **argv) { - const bool has_kvm = qtest_has_accel("kvm"); - const bool has_uffd = ufd_version_check(); - const char *arch = qtest_get_arch(); + bool has_kvm; + bool has_uffd; + const char *arch; g_autoptr(GError) err = NULL; int ret; g_test_init(&argc, &argv, NULL); + has_kvm = qtest_has_accel("kvm"); + has_uffd = ufd_version_check(); + arch = qtest_get_arch(); + /* * On ppc64, the test only works with kvm-hv, but not with kvm-pr and TCG * is touchy due to race conditions on dirty bits (especially on PPC for