From 30c6d99209cd36bba8e14795622f658827698522 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Thu, 24 Oct 2019 17:51:42 +0200 Subject: [PATCH] qemuxml2argvtest: Update host arch for DO_TEST*ARCH* tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid mismatch between host and QEMU capabilities. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- tests/qemuxml2argvtest.c | 4 ++++ tests/testutilsqemu.c | 6 +++--- tests/testutilsqemu.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 347cabe533..3a998e2efa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -699,9 +699,13 @@ mymain(void) __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ testInfoSetPaths(&info, _suffix); \ + if (info.arch != VIR_ARCH_NONE && info.arch != VIR_ARCH_X86_64) \ + qemuTestSetHostArch(driver.caps, info.arch); \ if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ + if (info.arch != VIR_ARCH_NONE && info.arch != VIR_ARCH_X86_64) \ + qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); \ testQemuInfoClear(&info); \ } while (0) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 5a7011478b..7b9e427463 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -1058,16 +1058,16 @@ testQemuInfoSetArgs(struct testQemuInfo *info, if (!qemuCaps && capsarch && capsver) { bool stripmachinealiases = false; + info->arch = virArchFromString(capsarch); + if (STREQ(capsver, "latest")) { capsfile = g_strdup(virHashLookup(capslatest, capsarch)); stripmachinealiases = true; } else capsfile = g_strdup_printf("%s/caps_%s.%s.xml", TEST_QEMU_CAPS_PATH, capsver, capsarch); - if (!(qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(capsarch), - capsfile))) { + if (!(qemuCaps = qemuTestParseCapabilitiesArch(info->arch, capsfile))) goto cleanup; - } if (stripmachinealiases) virQEMUCapsStripMachineAliases(qemuCaps); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 714a95bb7a..da3bf3ab7a 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -63,6 +63,7 @@ struct testQemuInfo { int migrateFd; unsigned int flags; unsigned int parseFlags; + virArch arch; }; virCapsPtr testQemuCapsInit(void);