aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/hd-geo-test.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2022-02-15 16:25:31 +0000
committerThomas Huth <thuth@redhat.com>2022-02-21 10:13:23 +0100
commitfedcc3793ef27ad17165536f1aa7e60700eb8067 (patch)
treeded5e12695950fb78e164f8b244f413e0fb3ab3f /tests/qtest/hd-geo-test.c
parente670f6d825d4dee248b311197fd4048469d6772b (diff)
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/qtest/hd-geo-test.c')
-rw-r--r--tests/qtest/hd-geo-test.c12
1 files changed, 9 insertions, 3 deletions
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);