qtest: Cover qdev property for BIOS CHS translation

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2012-07-10 11:12:49 +02:00 committed by Kevin Wolf
parent 6e6f61a66a
commit 856dcba23a
1 changed files with 7 additions and 6 deletions

View File

@ -321,15 +321,16 @@ static void test_ide_drive_user(const char *dev, bool trans)
const CHST expected_chst = { secs / (4 * 32) , 4, 32, trans }; const CHST expected_chst = { secs / (4 * 32) , 4, 32, trans };
argc = setup_common(argv, ARRAY_SIZE(argv)); argc = setup_common(argv, ARRAY_SIZE(argv));
opts = g_strdup_printf("%s,cyls=%d,heads=%d,secs=%d%s", opts = g_strdup_printf("%s,%s%scyls=%d,heads=%d,secs=%d",
dev && !trans ? dev : "", dev ?: "",
trans && dev ? "bios-chs-" : "",
trans ? "trans=lba," : "",
expected_chst.cyls, expected_chst.heads, expected_chst.cyls, expected_chst.heads,
expected_chst.secs, expected_chst.secs);
trans ? ",trans=lba" : "");
cur_ide[0] = &expected_chst; cur_ide[0] = &expected_chst;
argc = setup_ide(argc, argv, ARRAY_SIZE(argv), argc = setup_ide(argc, argv, ARRAY_SIZE(argv),
0, dev && !trans ? opts : NULL, backend_small, mbr_chs, 0, dev ? opts : NULL, backend_small, mbr_chs,
dev && !trans ? "" : opts); dev ? "" : opts);
g_free(opts); g_free(opts);
qtest_start(g_strjoinv(" ", argv)); qtest_start(g_strjoinv(" ", argv));
test_cmos(); test_cmos();