From patchwork Thu Mar 21 19:55:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160817 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192486jan; Thu, 21 Mar 2019 12:55:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1dVH+FUclhTZWktX1simm/2OM2r7R4X7LE782ERmx6z5Nja7R/himj0/bsd0xzSOVOxpZ X-Received: by 2002:a0c:87af:: with SMTP id 44mr4665740qvj.122.1553198123899; Thu, 21 Mar 2019 12:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198123; cv=none; d=google.com; s=arc-20160816; b=cJFAPcwq3ecx5Ylr5fB4desdrTyhYozRZ2cwT1cEs6ERD3Zj96dho8Ya4YXaA+0md4 V79+79/nURcHgfeOJgDIPN8xnVMhPdqNEfDNNHB58oSsXNHBadFjCgY6Q8A2Ngz7q9iQ j1mOFrEiUgnvJFRKgD+PLBIPgR65yXJL1xJI2+DwZx9zE1wnbSVHpXmKDnW0dOyIEce1 xc8lOzPF76HNxrMdoGsnW6rDmSTbk9U+gJSeS9tl7pS3O8trBrz2jNc4YrTL6T6R51Fe P2+FaV91Ws6V9ar3/1r8Lk+VAoNV1WA6kPDJyFcyxBTvAR/YR/9FeXzhB+qB1+XlqmFd NUEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=13yBKH44tyCDTCrtm+icdsjBNcb/1HfhpbTPbPCGFCI=; b=Adng2tyDg90B0Zsu5nVBc6UIuxJVnxFcYz2bSLoidRVzZTwIs5z42gDFT4K6f8awd1 l0LZKurwVSQ+Q7B+f7Pm7lLe2x49nJdapjvm+3dbAbB+JQ9sPk6WX3c/se0FqF2IU0Q4 pD/IPHmNZRKV6IXRTci+lluIUr1zR399VXmR9iCIWK0v4QZm/7gQ8Lty2DTJMJIf5iRC EKNHs719M/gqGSX7lOsCf1biUBZFJWbYIfw6hB7hes6N8oacFDQk5n39M7yS/6Xm3ZIN NUJ/9SiGDCZPeeZKAVA4nAicGaJA0zbsegJ8xjvvTJg0MUJkSUOHXxI76NTe+g/M0kx2 wOqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id e91si811955qtb.96.2019.03.21.12.55.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CD7D30821A3; Thu, 21 Mar 2019 19:55:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72C7619C71; Thu, 21 Mar 2019 19:55:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2ED2038BE; Thu, 21 Mar 2019 19:55:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtGQe020704 for ; Thu, 21 Mar 2019 15:55:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 71B531974C; Thu, 21 Mar 2019 19:55:16 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15BF019C59; Thu, 21 Mar 2019 19:55:15 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:03 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/4] tests: qemuxml2argv: Tweak TEST_CAPS_PATH X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 21 Mar 2019 19:55:23 +0000 (UTC) Make it an actual path and not a string prefix Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 14d3df02a9..d982a497a9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -819,7 +819,7 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate * version. */ -# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" +# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" # define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ do { \ @@ -827,7 +827,7 @@ mymain(void) .name = _name, \ .suffix = "." arch "-" ver, \ }; \ - static const char *capsfile = TEST_CAPS_PATH ver "." arch ".xml"; \ + static const char *capsfile = TEST_CAPS_PATH "/caps_" ver "." arch ".xml"; \ static bool stripmachinealiases; \ if (STREQ(ver, "latest")) { \ capsfile = virHashLookup(capslatest, arch); \ From patchwork Thu Mar 21 19:55:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160816 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192476jan; Thu, 21 Mar 2019 12:55:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw815eeCln+HljAi4Ybaz1yWPMuN8TXZ18esHtVSNqQySpHPcMQxyXNDCG2JwST/vpdna2 X-Received: by 2002:a0c:a3c1:: with SMTP id v59mr4661121qvv.159.1553198123111; Thu, 21 Mar 2019 12:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198123; cv=none; d=google.com; s=arc-20160816; b=mEh7R/CoiIOtc3fX/aAozTPE1WSKAuVvSR8O2P/h86yOBTSOBS9vou4JSy8cFDvERm 3uEvCynpeRDNPKxErtjqN7hs1Skb9xBiyAPfm4RLDmW6x1iiLzm2QWOLcVj4tTSHSBUj hIDJ9nlR9Bh91+Qm9CNu+0ga/orRC7YWejfefav7loOQ/qSnnm5/chPlEtZR01570DUh amHDFPXuVHfzuEVDq1vHBfnXRU+gydfnzqdMA4U+wmhwX1Q9D8QnP/Rx6ObyaZhcypFH oKdNCClPvw3zSsNS1fW5MASXeWL9XUvO3t6OeXn33+pBy+0PJHHBfFjwnMtvTa4Z/t9p db7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=ydIKhMCWv92vdK09ODe0hHNpOK1wE8Dc5lH4dBH7FOw=; b=aDjyscOGVw+Mecz4qmEwgvFGNg4Ijc1lT31oXdEW0znsw9YBAbK9iO+gB7ksHfbBo8 35kCfAMfq/ssfPp/yEFF/nNmYz5AL9cKvYVjeIjS2ScATZ7rILGFDbe+bDvLoq5+8tx7 216C/jqJSQUzCyoEQ2KP9aW7x03hsL7LeI9OX2x55WOSoxJ+ITEDXbTCoHdqunYjCekf IwyG16JE5xgHBrLMnloCg9w7e3AVK/evJHFlsBKqk7ssD5/U4+rdxFVlivcvGw5PyZUA 2j6LlRTut8KQeXXbvM6UjhRrivy6Hlc0uBVHCWFCdkWL3yeF4Ik7xyqVUFdkoM0UD3/b 8E6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id s24si3493123qkj.139.2019.03.21.12.55.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88C713D94D; Thu, 21 Mar 2019 19:55:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C3AE5D9C5; Thu, 21 Mar 2019 19:55:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0F9271803387; Thu, 21 Mar 2019 19:55:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtHmE020710 for ; Thu, 21 Mar 2019 15:55:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 049234108; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D00E19C71; Thu, 21 Mar 2019 19:55:16 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:04 -0400 Message-Id: <3591f921f167335d5d3cfe3fd9d97c246af9d515.1553197802.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/4] tests: qemuxml2argv: move DO_CAPS_TEST* qemuCaps init X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 21 Mar 2019 19:55:22 +0000 (UTC) Move DO_CAPS_TEST* qemuCaps init and all the associated setup into testInfoSetArgs, adding ARG_CAPS_ARCH and ARG_CAPS_VER options and using those to build the capsfile path locally Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 69 +++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 22 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d982a497a9..191a43726d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -605,6 +605,8 @@ testCompareXMLToArgv(const void *data) return ret; } +# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" + typedef enum { ARG_QEMU_CAPS, ARG_GIC, @@ -612,6 +614,8 @@ typedef enum { ARG_MIGRATE_FD, ARG_FLAGS, ARG_PARSEFLAGS, + ARG_CAPS_ARCH, + ARG_CAPS_VER, /* ARG_END is our va_args sentinel. The value QEMU_CAPS_LATEST is * necessary to handle the DO_TEST(..., NONE) case, which through macro @@ -628,15 +632,19 @@ typedef enum { } testInfoArgName; static int -testInfoSetArgs(struct testInfo *info, ...) +testInfoSetArgs(struct testInfo *info, + virHashTablePtr capslatest, ...) { va_list argptr; testInfoArgName argname; virQEMUCapsPtr qemuCaps = NULL; int gic = GIC_NONE; + char *capsarch = NULL; + char *capsver = NULL; + VIR_AUTOFREE(char *) capsfile = NULL; int ret = -1; - va_start(argptr, info); + va_start(argptr, capslatest); while ((argname = va_arg(argptr, testInfoArgName)) < ARG_END) { switch (argname) { case ARG_QEMU_CAPS: @@ -665,6 +673,14 @@ testInfoSetArgs(struct testInfo *info, ...) info->parseFlags = va_arg(argptr, int); break; + case ARG_CAPS_ARCH: + capsarch = va_arg(argptr, char *); + break; + + case ARG_CAPS_VER: + capsver = va_arg(argptr, char *); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -672,13 +688,32 @@ testInfoSetArgs(struct testInfo *info, ...) } } - if (!info->qemuCaps) { - if (!qemuCaps) { - fprintf(stderr, "No qemuCaps generated\n"); + if (!qemuCaps && capsarch && capsver) { + bool stripmachinealiases = false; + + if (STREQ(capsver, "latest")) { + if (VIR_STRDUP(capsfile, virHashLookup(capslatest, capsarch)) < 0) + goto cleanup; + stripmachinealiases = true; + } else if (virAsprintf(&capsfile, "%s/caps_%s.%s.xml", + TEST_CAPS_PATH, capsver, capsarch) < 0) { goto cleanup; } - VIR_STEAL_PTR(info->qemuCaps, qemuCaps); + + if (!(qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(capsarch), + capsfile))) + goto cleanup; + + if (stripmachinealiases) + virQEMUCapsStripMachineAliases(qemuCaps); + info->flags |= FLAG_REAL_CAPS; + } + + if (!qemuCaps) { + fprintf(stderr, "No qemuCaps generated\n"); + goto cleanup; } + VIR_STEAL_PTR(info->qemuCaps, qemuCaps); if (gic != GIC_NONE && testQemuCapsSetGIC(info->qemuCaps, gic) < 0) goto cleanup; @@ -819,28 +854,17 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate * version. */ -# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" - # define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ do { \ static struct testInfo info = { \ .name = _name, \ .suffix = "." arch "-" ver, \ }; \ - static const char *capsfile = TEST_CAPS_PATH "/caps_" ver "." arch ".xml"; \ - static bool stripmachinealiases; \ - if (STREQ(ver, "latest")) { \ - capsfile = virHashLookup(capslatest, arch); \ - stripmachinealiases = true; \ - } \ - if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ - capsfile))) \ - return EXIT_FAILURE; \ - if (stripmachinealiases) \ - virQEMUCapsStripMachineAliases(info.qemuCaps); \ - if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ + if (testInfoSetArgs(&info, capslatest, \ + ARG_CAPS_ARCH, arch, \ + ARG_CAPS_VER, ver, \ + __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ - info.flags |= FLAG_REAL_CAPS; \ if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ @@ -876,7 +900,8 @@ mymain(void) static struct testInfo info = { \ .name = _name, \ }; \ - if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ + if (testInfoSetArgs(&info, capslatest, \ + __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ From patchwork Thu Mar 21 19:55:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160818 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192535jan; Thu, 21 Mar 2019 12:55:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN+o0dwZ7KziGk9Bf6eYnciRN58Guu8mv+KfaYI98k7pDDGStgcl5dAO0YDcOy3L8LGGEI X-Received: by 2002:a37:4d52:: with SMTP id a79mr4359128qkb.75.1553198126851; Thu, 21 Mar 2019 12:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198126; cv=none; d=google.com; s=arc-20160816; b=F5HS7Yo0LVJATPAh/rRQEI8wX+RiN1tBAVxorw2ZO+a5TlmaDxmX0KKBY2lausLwYL miHWm79GNn8c4ObKQXqsaSNUGnUpzfsLBfy+dm935n1Kv3/kUkOn4YKv8A1vA00mMsNx Xxh0QQ1mmlsZZFioQ8ETECJESlF3kPCGkVoBk/P/7SqHPOLD1uKkE5I+u3+IoKGxw3Ws 8IrrWDXfuJv4O3ifMmugZ5o7USMBxTSxY3orCbD9Uf2pszeSky/Ny+7YuWRU7VVbvb2z ol0I7fzjdFRA8ATOkldXzgsJ6gO0XCuhKj7AP2HIUAHqVX7gac5TWq4Ld5nC755O1cEJ BSjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=jfEB+k6aEf8ju3We5dNq74PMpvRZvIwQ59HeaJ3uWoM=; b=h5Nt8INmB97rzL8fbB8MIU7EM8ZKyr6wGgh7OgRmUZDnus9kEAMikwvYe+TSKSKpEX rxSI5NhptEbU1fvpIdecgPzglkPCVPdEnLlcDHnlHszo2tzodhzWoIwHct0UTJOEyD05 fVx5tT8Gd5a04k/wcX+fV4pxUWvbkD/JVb9FkP/00nxHjhRVkBC6CKN1MUV0lrw4SOcF jK3Pjbj+/rI9XmZxLDhQvoImrnFUYlTYVv3sVG48JANBPMgsy1jnewYTPfD4zIldKWCH Lzw3Iw0Zaq0dVuqsAjIxpGxwHOnyhm6jjHiLpoMZ0jHzfELSUNDMAIri9Stp6uYzHO5P BJXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id i3si64249qkg.84.2019.03.21.12.55.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 604593092650; Thu, 21 Mar 2019 19:55:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EFE11018A35; Thu, 21 Mar 2019 19:55:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CAAE3180338C; Thu, 21 Mar 2019 19:55:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtH9l020718 for ; Thu, 21 Mar 2019 15:55:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D24F4108; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 318E319C59; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:05 -0400 Message-Id: <18de67cff7d62c950885a42f98c3d646579fa432.1553197802.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/4] tests: qemuxml2argv: report error on ARG_* collisions X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 21 Mar 2019 19:55:25 +0000 (UTC) * ARG_CAPS_ARCH must be specified with ARG_CAPS_VER * ARG_QEMU_CAPS shouldn't be specified with ARG_CAPS_* Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 191a43726d..34394181c1 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; From patchwork Thu Mar 21 19:55:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160819 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192555jan; Thu, 21 Mar 2019 12:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNIHyJA87pAhHxznvZ0Jl06lMsh8qNjbzDJdM92c0o4Ar5uBkMKQOLsRPZFKxgeH2kR2tm X-Received: by 2002:a0c:8693:: with SMTP id 19mr4798653qvf.73.1553198128267; Thu, 21 Mar 2019 12:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198128; cv=none; d=google.com; s=arc-20160816; b=aMEt81xT4vRZhddK1GaBW52HPFy7DNnNLMqt4xBF0ETnAcn/xY8JLGyKJFgLLPZsjW pTiCe44B6KHCs81s1nUBdGUKQuAnUtpcy3sqQXAsJu7mNCyF5bCeRbLqnJrMRwvbYOEa exjTzrHexmWTJokzWBuHilvL2qM8XufaPbg+JzbanLyPJSEQ+qgZuEoIEI6eGTWXPjpm dNeDfCMesWS3zSg+z/YkiXb6kF9SRkx5HH/KGARu9md4GgiqfngpoB6fJLN/lM583l6r 3SJ1DZJw4f4SHzPlDPPxen+Wx0WyEKsvLl3Tt3kpCaSl6CxjxvCH6DPmQwNvf6oQkjZQ gltw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=FmQRjBW98AB1S//+IXl1rsY2O2i2EHNc++se2+k0w40=; b=pOHgXqBcVassaCvVjgdyI1jnZA6BEsXXHZPT3SKRYbgVWzgOYxa5OTiKiCN4E5HBFV qe2xmMg7MVOQ7NTPyig6dbAaEHftnzeHkfIcU9sewezzjJIbk9EaL9T8gUFVbwJJlVIX X4jAGVWl1yGEB/g1gyUIhMe1ISoyW8dBhopPxGqBzb0zHCRbY4RpRV/SdecsLUQ5nfOT MpWOIPO3JQSHeDPUCuqCMAwA53H5N1D/DyIPQI2XcyCQnF9TW+vEwztmSzRDWl1Ns/1n /+kj6Fj50Yu99C77UevsyukrRENVM7YFwIKWhJHJaA3wPFcWc6/bOCVY+mb7XrIEkwPs dZlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id e189si943953qkb.27.2019.03.21.12.55.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93BEA308339A; Thu, 21 Mar 2019 19:55:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 641F51001DC1; Thu, 21 Mar 2019 19:55:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 239423FB14; Thu, 21 Mar 2019 19:55:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtIFw020724 for ; Thu, 21 Mar 2019 15:55:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 354DE4124; Thu, 21 Mar 2019 19:55:18 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B76374108; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:06 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v2 4/4] tests: qemuxml2argv: add DO_TEST_INTERNAL X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 21 Mar 2019 19:55:27 +0000 (UTC) Base macro to unify the actual testCompareXMLToArgv test calls Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 34394181c1..4b05b4e846 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -866,23 +866,27 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropriate * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ +# define DO_TEST_INTERNAL(_name, _suffix, ...) \ do { \ static struct testInfo info = { \ .name = _name, \ - .suffix = "." arch "-" ver, \ + .suffix = _suffix, \ }; \ if (testInfoSetArgs(&info, capslatest, \ - ARG_CAPS_ARCH, arch, \ - ARG_CAPS_VER, ver, \ __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ + if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ testInfoClear(&info); \ } while (0) +# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ + DO_TEST_INTERNAL(name, "." arch "-" ver, \ + ARG_CAPS_ARCH, arch, \ + ARG_CAPS_VER, ver, \ + __VA_ARGS__) + # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) @@ -907,19 +911,8 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR) -# define DO_TEST_FULL(_name, ...) \ - do { \ - static struct testInfo info = { \ - .name = _name, \ - }; \ - if (testInfoSetArgs(&info, capslatest, \ - __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ - return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name, \ - testCompareXMLToArgv, &info) < 0) \ - ret = -1; \ - testInfoClear(&info); \ - } while (0) +# define DO_TEST_FULL(name, ...) \ + DO_TEST_INTERNAL(name, "", __VA_ARGS__, QEMU_CAPS_LAST) /* All the following macros require an explicit QEMU_CAPS_* list * at the end of the argument list, or the NONE placeholder.