1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemuxml2argvtest: Update host arch for DO_TEST*ARCH* tests

To avoid mismatch between host and QEMU capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2019-10-24 17:51:42 +02:00
parent d8e1d39663
commit 30c6d99209
3 changed files with 8 additions and 3 deletions

View File

@ -699,9 +699,13 @@ mymain(void)
__VA_ARGS__, ARG_END) < 0) \ __VA_ARGS__, ARG_END) < 0) \
return EXIT_FAILURE; \ return EXIT_FAILURE; \
testInfoSetPaths(&info, _suffix); \ 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, \ if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \
testCompareXMLToArgv, &info) < 0) \ testCompareXMLToArgv, &info) < 0) \
ret = -1; \ ret = -1; \
if (info.arch != VIR_ARCH_NONE && info.arch != VIR_ARCH_X86_64) \
qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); \
testQemuInfoClear(&info); \ testQemuInfoClear(&info); \
} while (0) } while (0)

View File

@ -1058,16 +1058,16 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
if (!qemuCaps && capsarch && capsver) { if (!qemuCaps && capsarch && capsver) {
bool stripmachinealiases = false; bool stripmachinealiases = false;
info->arch = virArchFromString(capsarch);
if (STREQ(capsver, "latest")) { if (STREQ(capsver, "latest")) {
capsfile = g_strdup(virHashLookup(capslatest, capsarch)); capsfile = g_strdup(virHashLookup(capslatest, capsarch));
stripmachinealiases = true; stripmachinealiases = true;
} else capsfile = g_strdup_printf("%s/caps_%s.%s.xml", } else capsfile = g_strdup_printf("%s/caps_%s.%s.xml",
TEST_QEMU_CAPS_PATH, capsver, capsarch); TEST_QEMU_CAPS_PATH, capsver, capsarch);
if (!(qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(capsarch), if (!(qemuCaps = qemuTestParseCapabilitiesArch(info->arch, capsfile)))
capsfile))) {
goto cleanup; goto cleanup;
}
if (stripmachinealiases) if (stripmachinealiases)
virQEMUCapsStripMachineAliases(qemuCaps); virQEMUCapsStripMachineAliases(qemuCaps);

View File

@ -63,6 +63,7 @@ struct testQemuInfo {
int migrateFd; int migrateFd;
unsigned int flags; unsigned int flags;
unsigned int parseFlags; unsigned int parseFlags;
virArch arch;
}; };
virCapsPtr testQemuCapsInit(void); virCapsPtr testQemuCapsInit(void);