diff mbox series

[RFC,v4,09/15] tests/qtest: Adjust device-introspect-test to always set a -cpu option

Message ID 20230119135424.5417-10-farosas@suse.de (mailing list archive)
State New, archived
Headers show
Series target/arm: Allow CONFIG_TCG=n builds | expand

Commit Message

Fabiano Rosas Jan. 19, 2023, 1:54 p.m. UTC
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/qtest/device-introspect-test.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c
index 5b0ffe43f5..7d6ff6e3ef 100644
--- a/tests/qtest/device-introspect-test.c
+++ b/tests/qtest/device-introspect-test.c
@@ -304,17 +304,30 @@  static void test_abstract_interfaces(void)
     qtest_quit(qts);
 }
 
+static const char *arch_get_cpu(const char *mname)
+{
+    const char *arch = qtest_get_arch();
+
+    if (g_str_equal(arch, "aarch64")) {
+        if (!strncmp(mname, "virt", 4)) {
+            return "cortex-a57";
+        }
+    }
+
+    return NULL;
+}
+
 static void add_machine_test_case(const char *mname)
 {
     char *path, *args;
 
     path = g_strdup_printf("device/introspect/concrete/defaults/%s", mname);
-    args = g_strdup_printf("-M %s", mname);
+    args = qtest_get_machine_args(mname, arch_get_cpu(mname), NULL);
     qtest_add_data_func(path, args, test_device_intro_concrete);
     g_free(path);
 
     path = g_strdup_printf("device/introspect/concrete/nodefaults/%s", mname);
-    args = g_strdup_printf("-nodefaults -M %s", mname);
+    args = qtest_get_machine_args(mname, arch_get_cpu(mname), "-nodefaults");
     qtest_add_data_func(path, args, test_device_intro_concrete);
     g_free(path);
 }