[libvirt] [PATCH 05/21] tests: qemuxml2argv: break apart testInitQEMUCaps

Cole Robinson crobinso at redhat.com
Thu Mar 14 14:43:58 UTC 2019


Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 tests/qemuxml2argvtest.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 393d2399fa..06a28178d0 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -378,25 +378,6 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
 }
 
 
-static int
-testInitQEMUCaps(struct testInfo *info,
-                 int gic)
-{
-    int ret = -1;
-
-    if (!(info->qemuCaps = virQEMUCapsNew()))
-        goto cleanup;
-
-    if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
-        goto cleanup;
-
-    ret = 0;
-
- cleanup:
-    return ret;
-}
-
-
 static int
 testUpdateQEMUCaps(const struct testInfo *info,
                    virDomainObjPtr vm,
@@ -840,7 +821,9 @@ mymain(void)
         static struct testInfo info = { \
             name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \
         }; \
-        if (testInitQEMUCaps(&info, gic) < 0) \
+        if (!(info.qemuCaps = virQEMUCapsNew())) \
+            return EXIT_FAILURE; \
+        if (testQemuCapsSetGIC(info.qemuCaps, gic) < 0) \
             return EXIT_FAILURE; \
         if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \
             return EXIT_FAILURE; \
-- 
2.20.1




More information about the libvir-list mailing list