[libvirt] [PATCHv2 0/7] qemuxml2argvtest cleanups

Ján Tomko jtomko at redhat.com
Wed Sep 12 13:30:46 UTC 2018


Patch 1 and patch 3 were not acked in v1.
The changes to the ACKed ones are minimal.
Complete diff to v2:

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 867e0d569f..0e43320b96 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -460,20 +460,20 @@ testCompareXMLToStartupXML(const void *data)
 }


-# define TEST_EXCLUSIVE_FLAGS(FLAG1, FLAG2) \
-    if ((testFlags & FLAG1) && (testFlags & FLAG2)) { \
-        VIR_TEST_DEBUG("Flags %s and %s are mutually exclusive\n", \
-                       #FLAG1, #FLAG2); \
-        return -1; \
-    }
-
-
 static int
-testCheckExclusiveFlags(int testFlags ATTRIBUTE_UNUSED)
+testCheckExclusiveFlags(int flags)
 {
-    TEST_EXCLUSIVE_FLAGS(FLAG_STEAL_VM, FLAG_EXPECT_FAILURE);
-    TEST_EXCLUSIVE_FLAGS(FLAG_STEAL_VM, FLAG_EXPECT_PARSE_ERROR);
-    TEST_EXCLUSIVE_FLAGS(FLAG_REAL_CAPS, FLAG_SKIP_LEGACY_CPUS);
+    virCheckFlags(FLAG_EXPECT_FAILURE |
+                  FLAG_EXPECT_PARSE_ERROR |
+                  FLAG_FIPS |
+                  FLAG_STEAL_VM |
+                  FLAG_REAL_CAPS |
+                  FLAG_SKIP_LEGACY_CPUS |
+                  0, -1);
+
+    VIR_EXCLUSIVE_FLAGS_RET(FLAG_STEAL_VM, FLAG_EXPECT_FAILURE, -1);
+    VIR_EXCLUSIVE_FLAGS_RET(FLAG_STEAL_VM, FLAG_EXPECT_PARSE_ERROR, -1);
+    VIR_EXCLUSIVE_FLAGS_RET(FLAG_REAL_CAPS, FLAG_SKIP_LEGACY_CPUS, -1);
     return 0;
 }

Ján Tomko (7):
  tests: add a function for checking exclusive flags
  tests: introduce macro for qemu XML->startup XML
  tests: only run startup XML tests if requested
  tests: report errors in QEMU XML->startup XML tests
  tests: do not mangle real qemu caps in xml2argvtest
  tests: turn skipLegacyCPUs into a flag
  qemu: remove unnecessary virQEMUCapsFreeHostCPUModel

 src/qemu/qemu_capabilities.c | 25 ++-------------
 src/qemu/qemu_capspriv.h     |  5 ---
 tests/qemuxml2argvtest.c     | 74 ++++++++++++++++++++++++++++----------------
 3 files changed, 49 insertions(+), 55 deletions(-)

-- 
2.16.4




More information about the libvir-list mailing list