summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDr. David Alan Gilbert2022-02-15 17:25:31 +0100
committerThomas Huth2022-02-21 10:13:23 +0100
commitfedcc3793ef27ad17165536f1aa7e60700eb8067 (patch)
treeded5e12695950fb78e164f8b244f413e0fb3ab3f /tests
parentMerge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220218' into s... (diff)
downloadqemu-fedcc3793ef27ad17165536f1aa7e60700eb8067.tar.gz
qemu-fedcc3793ef27ad17165536f1aa7e60700eb8067.tar.xz
qemu-fedcc3793ef27ad17165536f1aa7e60700eb8067.zip
tests/x86: Use 'pc' machine type for old hardware tests
For tests that rely on old hardware, e.g. floppies or IDE drives, explicitly select the 'pc' machine type. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220215162537.605030-2-dgilbert@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/fdc-test.c2
-rw-r--r--tests/qtest/hd-geo-test.c12
-rw-r--r--tests/qtest/i440fx-test.c2
-rw-r--r--tests/qtest/ide-test.c3
4 files changed, 13 insertions, 6 deletions
diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c
index 8f6eee84a4..b0d40012e6 100644
--- a/tests/qtest/fdc-test.c
+++ b/tests/qtest/fdc-test.c
@@ -598,7 +598,7 @@ int main(int argc, char **argv)
/* Run the tests */
g_test_init(&argc, &argv, NULL);
- qtest_start("-device floppy,id=floppy0");
+ qtest_start("-machine pc -device floppy,id=floppy0");
qtest_irq_intercept_in(global_qtest, "ioapic");
qtest_add_func("/fdc/cmos", test_cmos);
qtest_add_func("/fdc/no_media_on_start", test_no_media_on_start);
diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c
index 771eaa741b..3554b5d500 100644
--- a/tests/qtest/hd-geo-test.c
+++ b/tests/qtest/hd-geo-test.c
@@ -178,9 +178,15 @@ static int append_arg(int argc, char *argv[], int argv_sz, char *arg)
static int setup_common(char *argv[], int argv_sz)
{
+ int new_argc;
memset(cur_ide, 0, sizeof(cur_ide));
- return append_arg(0, argv, argv_sz,
- g_strdup("-nodefaults"));
+ new_argc = append_arg(0, argv, argv_sz,
+ g_strdup("-nodefaults"));
+ new_argc = append_arg(new_argc, argv, argv_sz,
+ g_strdup("-machine"));
+ new_argc = append_arg(new_argc, argv, argv_sz,
+ g_strdup("pc"));
+ return new_argc;
}
static void setup_mbr(int img_idx, MBRcontents mbr)
@@ -697,7 +703,7 @@ static void test_override(TestArgs *args, CHSResult expected[])
joined_args = g_strjoinv(" ", args->argv);
- qts = qtest_init(joined_args);
+ qts = qtest_initf("-machine pc %s", joined_args);
fw_cfg = pc_fw_cfg_init(qts);
read_bootdevices(fw_cfg, expected);
diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c
index 1f57d9684b..6d7d4d8d8f 100644
--- a/tests/qtest/i440fx-test.c
+++ b/tests/qtest/i440fx-test.c
@@ -35,7 +35,7 @@ static QPCIBus *test_start_get_bus(const TestData *s)
{
char *cmdline;
- cmdline = g_strdup_printf("-smp %d", s->num_cpus);
+ cmdline = g_strdup_printf("-machine pc -smp %d", s->num_cpus);
qtest_start(cmdline);
g_free(cmdline);
return qpci_new_pc(global_qtest, NULL);
diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c
index 3f8081e77d..84935578fb 100644
--- a/tests/qtest/ide-test.c
+++ b/tests/qtest/ide-test.c
@@ -128,10 +128,11 @@ static char debug_path[] = "/tmp/qtest-blkdebug.XXXXXX";
static QTestState *ide_test_start(const char *cmdline_fmt, ...)
{
QTestState *qts;
+ g_autofree char *full_fmt = g_strdup_printf("-machine pc %s", cmdline_fmt);
va_list ap;
va_start(ap, cmdline_fmt);
- qts = qtest_vinitf(cmdline_fmt, ap);
+ qts = qtest_vinitf(full_fmt, ap);
va_end(ap);
pc_alloc_init(&guest_malloc, qts, 0);