Skip to contentSkip to conversation

tests/qtest/migration: Add a check for the availability of the "pc" machine

PATCH In review Thomas Huth 2 participants 2 messages Sep 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest/migration: Add a check for the availability of the "pc" machine

The test_vcpu_dirty_limit is the only test that does not check for the availability of the machine before starting the test, so it fails when QEMU has been configured with --without-default-devices. Add a check for the "pc" machine type to fix it.

---
 tests/qtest/migration-test.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/migration-test.c +4 -2
index 6c06100d91..8fee18dfbe 100644
@@ -4026,8 +4026,10 @@ int main(int argc, char **argv)
     if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) {
         migration_test_add("/migration/dirty_ring",
                            test_precopy_unix_dirty_ring);
-        migration_test_add("/migration/vcpu_dirty_limit",
-                           test_vcpu_dirty_limit);
+        if (qtest_has_machine("pc")) {
+            migration_test_add("/migration/vcpu_dirty_limit",
+                               test_vcpu_dirty_limit);
+        }
     }
 
     ret = g_test_run();
Signature · 1 line
2.46.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Thomas Huth

The test_vcpu_dirty_limit is the only test that does not check for the availability of the machine before starting the test, so it fails when QEMU has been configured with --without-default-devices. Add a check for the "pc" machine type to fix it.

---
 tests/qtest/migration-test.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/qtest/migration-test.c +0 -0
index 6c06100d91..8fee18dfbe 100644
@@ -4026,8 +4026,10 @@ int main(int argc, char **argv)
     if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) {
         migration_test_add("/migration/dirty_ring",

tests/qtest/migration-test.c int main(int argc, char **argv) · line 4035

Quoted 10 lines
tests/qtest/migration-test.c +4 -2
                            test_precopy_unix_dirty_ring);
-        migration_test_add("/migration/vcpu_dirty_limit",
-                           test_vcpu_dirty_limit);
+        if (qtest_has_machine("pc")) {
+            migration_test_add("/migration/vcpu_dirty_limit",
+                               test_vcpu_dirty_limit);
+        }
     }
 
     ret = g_test_run();