From: Cole Robinson Date: Thu, 21 Mar 2019 19:16:21 +0000 (-0400) Subject: tests: qemuxml2argv: report error on ARG_* collisions X-Git-Tag: v5.2.0-rc1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fa656384ee59f92cd96ef3c2bb23f4e40360b38;p=thirdparty%2Flibvirt.git tests: qemuxml2argv: report error on ARG_* collisions * ARG_CAPS_ARCH must be specified with ARG_CAPS_VER * ARG_QEMU_CAPS shouldn't be specified with ARG_CAPS_* Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3db0da241d..20fef8f672 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -688,6 +688,18 @@ testInfoSetArgs(struct testInfo *info, } } + if (!!capsarch ^ !!capsver) { + fprintf(stderr, "ARG_CAPS_ARCH and ARG_CAPS_VER " + "must be specified together.\n"); + goto cleanup; + } + + if (qemuCaps && (capsarch || capsver)) { + fprintf(stderr, "ARG_QEMU_CAPS can not be combined with ARG_CAPS_ARCH " + "or ARG_CAPS_VER\n"); + goto cleanup; + } + if (!qemuCaps && capsarch && capsver) { bool stripmachinealiases = false;