From 6433783be32f5f1f1cc436e47f7bf05eed6f4f2e Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 13 Mar 2019 18:20:57 -0400 Subject: [PATCH] tests: qemuxml2argv: add testInfoSetArgs For now it just fills in the qemuCaps list. We will expand it in future patches Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 67c5c74ec5..a540e762fa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -624,6 +624,19 @@ testCompareXMLToArgv(const void *data) return ret; } +static int +testInfoSetArgs(struct testInfo *info, ...) +{ + va_list argptr; + int ret = 0; + + va_start(argptr, info); + virQEMUCapsSetVAList(info->qemuCaps, argptr); + va_end(argptr); + + return ret; +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" static int @@ -809,7 +822,8 @@ mymain(void) }; \ if (testInitQEMUCaps(&info, gic) < 0) \ return EXIT_FAILURE; \ - virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \ + if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST) < 0) \ + return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " name, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \