]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2argv: break apart testInitQEMUCaps
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Mar 2019 19:31:16 +0000 (15:31 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 21 Mar 2019 16:43:01 +0000 (12:43 -0400)
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
tests/qemuxml2argvtest.c

index 4084c5e6a0d710ae75751d9bb7eedf871c6332e4..97d3a55f563dd7f02d8806517216c0fe18a6aa4b 100644 (file)
@@ -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,
@@ -853,7 +834,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; \