qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qtests: avoid printing comments before g_test_init()
@ 2023-03-17 17:05 Daniel P. Berrangé
  2023-03-17 17:08 ` Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2023-03-17 17:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Juan Quintela, Laurent Vivier, Thomas Huth, Paolo Bonzini,
	Dr. David Alan Gilbert, Daniel P. Berrangé

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é <berrange@redhat.com>
---
 tests/qtest/migration-test.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 75d4f1d4a9..3b615b0da9 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
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-24 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17 17:05 [PATCH] qtests: avoid printing comments before g_test_init() Daniel P. Berrangé
2023-03-17 17:08 ` Peter Maydell
2023-03-17 17:28 ` Alex Bennée
2023-03-20  8:01 ` Thomas Huth
2023-03-23 18:31 ` Juan Quintela
2023-03-24  7:34   ` Thomas Huth
2023-03-24 17:29     ` Juan Quintela
2023-03-24 17:39       ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).