From nobody Sun Feb 8 07:59:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552574694838181.68954921240834; Thu, 14 Mar 2019 07:44:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 269BEC08E293; Thu, 14 Mar 2019 14:44:53 +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 F21805C241; Thu, 14 Mar 2019 14:44:52 +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 AC008181A137; Thu, 14 Mar 2019 14:44:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2EEimKX024659 for ; Thu, 14 Mar 2019 10:44:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E55160FDB; Thu, 14 Mar 2019 14:44:48 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-124-177.rdu2.redhat.com [10.10.124.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4661060F89; Thu, 14 Mar 2019 14:44:46 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:10 -0400 Message-Id: <3ff1cdf384d4f47a84ff76a894374d618c83732a.1552574299.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/21] tests: qemuxml2argv: build capsfile in DO_TEST_CAPS_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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 14 Mar 2019 14:44:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Rather than make callers do it. The operative info is just arch and ver which we are passing in already. Fold in stripmachinealiases too since it is just dependent on ver value Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 4b34bbcb63..496e33f4e5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -786,13 +786,20 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, \ - capsfile, stripmachinealiases, ...) \ +# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" + +# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ do { \ static struct testInfo info =3D { \ .name =3D _name, \ .suffix =3D "." arch "-" ver, \ }; \ + static const char *capsfile =3D TEST_CAPS_PATH ver "." arch ".xml"= ; \ + static bool stripmachinealiases; \ + if (STREQ(ver, "latest")) { \ + capsfile =3D virHashLookup(capslatest, arch); \ + stripmachinealiases =3D true; \ + } \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ return EXIT_FAILURE; \ @@ -807,23 +814,15 @@ mymain(void) virObjectUnref(info.qemuCaps); \ } while (0) =20 -# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" - -# define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \ - DO_TEST_CAPS_INTERNAL(name, arch, ver, \ - TEST_CAPS_PATH ver "." arch ".xml", false, \ - __VA_ARGS__) =20 # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ - DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ARG_END) + DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) =20 # define DO_TEST_CAPS_VER(name, ver) \ DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) =20 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \ - DO_TEST_CAPS_INTERNAL(name, arch, "latest", \ - virHashLookup(capslatest, arch), true, \ - __VA_ARGS__) + DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__) =20 # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list