From: Cole Robinson Date: Wed, 13 Mar 2019 19:31:16 +0000 (-0400) Subject: tests: qemuxml2argv: break apart testInitQEMUCaps X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=646eb207eb723f0662872b0abc86d6f8f9e37f10;p=libvirt.git tests: qemuxml2argv: break apart testInitQEMUCaps Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4084c5e6a0..97d3a55f56 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, @@ -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; \