]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuxml2argvtest: Update host arch for DO_TEST*ARCH* tests
authorJiri Denemark <jdenemar@redhat.com>
Thu, 24 Oct 2019 15:51:42 +0000 (17:51 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 20 Nov 2019 16:22:07 +0000 (17:22 +0100)
To avoid mismatch between host and QEMU capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvtest.c
tests/testutilsqemu.c
tests/testutilsqemu.h

index 347cabe5337be75079c82c71024b38a28fe74b63..3a998e2efa7a5371d70fbedbb066942ce8e27b40 100644 (file)
@@ -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)
 
index 5a7011478b89c4f7b5631ba6bbe1eab2dfce391d..7b9e427463f7514a18a31886acc39f39e77dee0b 100644 (file)
@@ -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);
index 714a95bb7aafbdf5864687a728654fbf4b5cea8d..da3bf3ab7ad8159cb194cae4c5b9e432e5533c22 100644 (file)
@@ -63,6 +63,7 @@ struct testQemuInfo {
     int migrateFd;
     unsigned int flags;
     unsigned int parseFlags;
+    virArch arch;
 };
 
 virCapsPtr testQemuCapsInit(void);