[PATCH v2 08/23] qemuxml2argvtest: Rename DO_TEST_INTERNAL to DO_TEST_FULL and fix users

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'DO_TEST_FULL' isn't a useful wrapper any more. Use the better name for
the main macro and replace all uses.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/qemuxml2argvtest.c | 83 +++++++++++++++++++++-------------------
 1 file changed, 43 insertions(+), 40 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 6162ebf3bb..6869eb6d86 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -936,7 +936,7 @@ mymain(void)
  * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate
  * version.
  */
-# define DO_TEST_INTERNAL(_name, _suffix, ...) \
+# define DO_TEST_FULL(_name, _suffix, ...) \
     do { \
         static struct testQemuInfo info = { \
             .name = _name, \
@@ -953,11 +953,11 @@ mymain(void)
     } while (0)

 # define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \
-    DO_TEST_INTERNAL(name, "." arch "-" ver, \
-                     ARG_CAPS_ARCH, arch, \
-                     ARG_CAPS_VER, ver, \
-                     __VA_ARGS__, \
-                     ARG_END)
+    DO_TEST_FULL(name, "." arch "-" ver, \
+                 ARG_CAPS_ARCH, arch, \
+                 ARG_CAPS_VER, ver, \
+                 __VA_ARGS__, \
+                 ARG_END)

 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
     DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__)
@@ -1008,31 +1008,26 @@ mymain(void)
 # define DO_TEST_CAPS_VER_PARSE_ERROR(name, ver) \
     DO_TEST_CAPS_ARCH_VER_PARSE_ERROR(name, "x86_64", ver)

-# define DO_TEST_FULL(name, ...) \
-    DO_TEST_INTERNAL(name, "", \
-                     __VA_ARGS__, ARG_END)
-
 /* All the following macros require an explicit QEMU_CAPS_* list
  * at the end of the argument list, or the NONE placeholder.
  * */
 # define DO_TEST(name, ...) \
-    DO_TEST_FULL(name, \
-                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
+    DO_TEST_FULL(name, "", ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END)

 # define DO_TEST_GIC(name, gic, ...) \
-    DO_TEST_FULL(name, \
+    DO_TEST_FULL(name, "", \
                  ARG_GIC, gic, \
-                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
+                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END)

 # define DO_TEST_FAILURE(name, ...) \
-    DO_TEST_FULL(name, \
+    DO_TEST_FULL(name, "", \
                  ARG_FLAGS, FLAG_EXPECT_FAILURE, \
-                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
+                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END)

 # define DO_TEST_PARSE_ERROR(name, ...) \
-    DO_TEST_FULL(name, \
+    DO_TEST_FULL(name, "", \
                  ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \
-                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
+                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END)

 # define NONE QEMU_CAPS_LAST

@@ -2014,25 +2009,28 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ap-boot-fail",
                                          "s390x");

-    DO_TEST_FULL("restore-v2",
+    DO_TEST_FULL("restore-v2", "",
                  ARG_MIGRATE_FROM, "exec:cat",
-                 ARG_MIGRATE_FD, 7);
-    DO_TEST_FULL("restore-v2-fd",
+                 ARG_MIGRATE_FD, 7,
+                 ARG_END);
+    DO_TEST_FULL("restore-v2-fd", "",
                  ARG_MIGRATE_FROM, "stdio",
-                 ARG_MIGRATE_FD, 7);
-    DO_TEST_FULL("restore-v2-fd",
+                 ARG_MIGRATE_FD, 7,
+                 ARG_END);
+    DO_TEST_FULL("restore-v2-fd", "",
                  ARG_MIGRATE_FROM, "fd:7",
-                 ARG_MIGRATE_FD, 7);
-    DO_TEST_FULL("migrate",
-                 ARG_MIGRATE_FROM, "tcp:10.0.0.1:5000");
+                 ARG_MIGRATE_FD, 7, ARG_END);
+    DO_TEST_FULL("migrate", "",
+                 ARG_MIGRATE_FROM, "tcp:10.0.0.1:5000", ARG_END);

-    DO_TEST_FULL("migrate-numa-unaligned",
+    DO_TEST_FULL("migrate-numa-unaligned", "",
                  ARG_MIGRATE_FROM, "stdio",
                  ARG_MIGRATE_FD, 7,
                  ARG_QEMU_CAPS,
                  QEMU_CAPS_NUMA,
                  QEMU_CAPS_OBJECT_MEMORY_RAM,
-                 QEMU_CAPS_LAST);
+                 QEMU_CAPS_LAST,
+                 ARG_END);

     DO_TEST_CAPS_VER("qemu-ns", "4.0.0");
     DO_TEST_CAPS_LATEST("qemu-ns");
@@ -2076,10 +2074,11 @@ mymain(void)
     DO_TEST("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_FILE);
     DO_TEST("cpu-host-model", NONE);
     DO_TEST("cpu-host-model-vendor", NONE);
-    DO_TEST_FULL("cpu-host-model-fallback",
-                 ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS);
-    DO_TEST_FULL("cpu-host-model-nofallback",
-                 ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE);
+    DO_TEST_FULL("cpu-host-model-fallback", "",
+                 ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS, ARG_END);
+    DO_TEST_FULL("cpu-host-model-nofallback", "",
+                 ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE,
+                 ARG_END);
     DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM);
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);

@@ -3100,14 +3099,15 @@ mymain(void)
     DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
             QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
             QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
-    DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update",
+    DO_TEST_FULL("memory-hotplug-ppc64-nonuma-abi-update", "",
                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
                  ARG_QEMU_CAPS,
                  QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM,
                  QEMU_CAPS_NUMA, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
                  QEMU_CAPS_OBJECT_MEMORY_RAM,
                  QEMU_CAPS_OBJECT_MEMORY_FILE,
-                 QEMU_CAPS_LAST);
+                 QEMU_CAPS_LAST,
+                 ARG_END);
     DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm");
     DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-access");
     DO_TEST_CAPS_VER("memory-hotplug-nvdimm-label", "5.2.0");
@@ -3121,13 +3121,14 @@ mymain(void)
     DO_TEST("memory-hotplug-nvdimm-ppc64", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
                                            QEMU_CAPS_OBJECT_MEMORY_FILE,
                                            QEMU_CAPS_DEVICE_NVDIMM);
-    DO_TEST_FULL("memory-hotplug-nvdimm-ppc64-abi-update",
+    DO_TEST_FULL("memory-hotplug-nvdimm-ppc64-abi-update", "",
                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
                  ARG_QEMU_CAPS,
                  QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
                  QEMU_CAPS_OBJECT_MEMORY_FILE,
                  QEMU_CAPS_DEVICE_NVDIMM,
-                 QEMU_CAPS_LAST);
+                 QEMU_CAPS_LAST,
+                 ARG_END);
     DO_TEST_CAPS_VER("memory-hotplug-virtio-pmem", "5.2.0");
     DO_TEST_CAPS_LATEST("memory-hotplug-virtio-pmem");

@@ -3239,13 +3240,14 @@ mymain(void)
     DO_TEST("ppc64-usb-controller-legacy",
             QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
             QEMU_CAPS_PIIX3_USB_UHCI);
-    DO_TEST_FULL("ppc64-usb-controller-qemu-xhci",
+    DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", "",
                  ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE,
                  ARG_QEMU_CAPS,
                  QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
                  QEMU_CAPS_NEC_USB_XHCI,
                  QEMU_CAPS_DEVICE_QEMU_XHCI,
-                 QEMU_CAPS_LAST);
+                 QEMU_CAPS_LAST,
+                 ARG_END);

     DO_TEST_PARSE_ERROR("ppc64-tpmproxy-double",
                         QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
@@ -3280,9 +3282,10 @@ mymain(void)
      * the wrong binary for the arch. We expect to get a failure about
      * bad arch later when creating the pretend command.
      */
-    DO_TEST_FULL("missing-machine",
+    DO_TEST_FULL("missing-machine", "",
                  ARG_FLAGS, FLAG_EXPECT_FAILURE,
-                 ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
+                 ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE,
+                 ARG_END);

     DO_TEST("name-escape",
             QEMU_CAPS_NAME_DEBUG_THREADS,
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux