From nobody Wed Apr 24 09:44:40 2024 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 1552574676643696.1036354767707; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 016627C83A; Thu, 14 Mar 2019 14:44:35 +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 CB20017DC4; Thu, 14 Mar 2019 14:44:34 +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 8CCA43FB10; Thu, 14 Mar 2019 14:44:34 +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 x2EEiMSh024479 for ; Thu, 14 Mar 2019 10:44:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A5B860F89; Thu, 14 Mar 2019 14:44:22 +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 98CEC60BE6; Thu, 14 Mar 2019 14:44:21 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:54 -0400 Message-Id: <5b3efbd783559ee6241167a7913943db2d4fbc0d.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 01/21] qemu: add virQEMUCapsSetVList 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 14 Mar 2019 14:44:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It will be used in future patches Signed-off-by: Cole Robinson --- src/qemu/qemu_capabilities.c | 14 +++++++++++--- src/qemu/qemu_capabilities.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4c8229fbda..a274ce7992 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1664,14 +1664,22 @@ virQEMUCapsSet(virQEMUCapsPtr qemuCaps, =20 =20 void -virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) +virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, va_list list) { - va_list list; int flag; =20 - va_start(list, qemuCaps); while ((flag =3D va_arg(list, int)) < QEMU_CAPS_LAST) ignore_value(virBitmapSetBit(qemuCaps->flags, flag)); +} + + +void +virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) +{ + va_list list; + + va_start(list, qemuCaps); + virQEMUCapsSetVList(qemuCaps, list); va_end(list); } =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 06c7606e2f..3601207989 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -518,6 +518,8 @@ virQEMUCapsPtr virQEMUCapsNew(void); void virQEMUCapsSet(virQEMUCapsPtr qemuCaps, virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1); =20 +void virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, + va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONN= ULL(2); void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1); =20 void virQEMUCapsClear(virQEMUCapsPtr qemuCaps, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574667966619.9371095039946; Thu, 14 Mar 2019 07:44:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C11997C84D; Thu, 14 Mar 2019 14:44:25 +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 9273E605CA; Thu, 14 Mar 2019 14:44: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 2D47E41F3D; Thu, 14 Mar 2019 14:44:25 +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 x2EEiMWx024488 for ; Thu, 14 Mar 2019 10:44:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9E01160FDB; Thu, 14 Mar 2019 14:44:22 +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 38B7C60BE6; Thu, 14 Mar 2019 14:44:22 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:55 -0400 Message-Id: <17389ec524a5d1e5950fa2ae423f106c47508ed4.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 02/21] tests: qemuxml2argv: add testInfoSetArgs 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 14 Mar 2019 14:44:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" For now it just fills in the qemuCaps list. We will expand it in future patches Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 67c5c74ec5..3b90cd1873 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -624,6 +624,18 @@ testCompareXMLToArgv(const void *data) return ret; } =20 +static int +testInfoSetArgs(struct testInfo *info, ...) +{ + va_list argptr; + int ret =3D 0; + + va_start(argptr, info); + virQEMUCapsSetVList(info->qemuCaps, argptr); + va_end(argptr); + return ret; +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" =20 static int @@ -809,7 +821,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 =3D -1; \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574676742747.0771377498119; Thu, 14 Mar 2019 07:44:36 -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 01BE330018C2; Thu, 14 Mar 2019 14:44:35 +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 C9C1D4C4; Thu, 14 Mar 2019 14:44:34 +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 8A832181A263; Thu, 14 Mar 2019 14:44:34 +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 x2EEiNUM024495 for ; Thu, 14 Mar 2019 10:44:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3C8CE60FAB; Thu, 14 Mar 2019 14:44:23 +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 CC97160BE6; Thu, 14 Mar 2019 14:44:22 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:56 -0400 Message-Id: <185092267f0b872f526bd5b9f17372ce252b53da.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 03/21] tests: qemuxml2argv: add va_arg enum handling 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.46]); Thu, 14 Mar 2019 14:44:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This establishes a pattern that will allow us to make test macros more general purpose, by taking optional arguments. The general format will be: DO_TEST_FULL(... ARG_FOO, , ARG_BAR, ) ARG_X are just enum values that we look for in the va_args and know how to interpret. Implement this for the existing implicit qemuCaps va_args Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b90cd1873..0dba908c70 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -624,14 +624,35 @@ testCompareXMLToArgv(const void *data) return ret; } =20 +typedef enum { + ARG_QEMU_CAPS =3D 1, + + ARG_END =3D QEMU_CAPS_LAST, +} testInfoArgNames; + static int testInfoSetArgs(struct testInfo *info, ...) { va_list argptr; - int ret =3D 0; + testInfoArgNames argname; + int ret =3D -1; =20 va_start(argptr, info); - virQEMUCapsSetVList(info->qemuCaps, argptr); + while ((argname =3D va_arg(argptr, int)) < ARG_END) { + switch (argname) { + case ARG_QEMU_CAPS: + virQEMUCapsSetVList(info->qemuCaps, argptr); + break; + + case ARG_END: + default: + fprintf(stderr, "Unexpected test info argument"); + goto cleanup; + } + } + + ret =3D 0; + cleanup: va_end(argptr); return ret; } @@ -821,7 +842,8 @@ mymain(void) }; \ if (testInitQEMUCaps(&info, gic) < 0) \ return EXIT_FAILURE; \ - if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST) < 0) \ + if (testInfoSetArgs(&info, ARG_QEMU_CAPS, \ + __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " name, \ testCompareXMLToArgv, &info) < 0) \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574681133277.6800756869602; Thu, 14 Mar 2019 07:44:41 -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 1FD0EC04AC5A; Thu, 14 Mar 2019 14:44:39 +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 E5D6D692A8; Thu, 14 Mar 2019 14:44:38 +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 A504D3FAF4; Thu, 14 Mar 2019 14:44:38 +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 x2EEiNrb024500 for ; Thu, 14 Mar 2019 10:44:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id CF0CF60F89; Thu, 14 Mar 2019 14:44:23 +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 6AED760BE6; Thu, 14 Mar 2019 14:44:23 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:57 -0400 Message-Id: <36d23d16670d4d11379c741401dbcb82087c3755.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 04/21] tests: qemuxml2argv: push ARG_QEMU_CAPS to callers 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:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is necessary before we can start adding more optional parameter implementations to DO_TEST_FULL Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0dba908c70..393d2399fa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -842,8 +842,7 @@ mymain(void) }; \ if (testInitQEMUCaps(&info, gic) < 0) \ return EXIT_FAILURE; \ - if (testInfoSetArgs(&info, ARG_QEMU_CAPS, \ - __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ + if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) <= 0) \ return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " name, \ testCompareXMLToArgv, &info) < 0) \ @@ -852,24 +851,29 @@ mymain(void) } while (0) =20 # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__) + DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, \ + ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, gic, __VA_ARGS__) + DO_TEST_FULL(name, NULL, -1, 0, 0, gic, \ + ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ - 0, GIC_NONE, __VA_ARGS__) + 0, GIC_NONE, \ + ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_ERROR(name, ...) \ DO_TEST_FULL(name, NULL, -1, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ - 0, GIC_NONE, __VA_ARGS__) + 0, GIC_NONE, \ + ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ DO_TEST_FULL(name, NULL, -1, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ - parseFlags, GIC_NONE, __VA_ARGS__) + parseFlags, GIC_NONE, \ + ARG_QEMU_CAPS, __VA_ARGS__) =20 # define NONE QEMU_CAPS_LAST =20 @@ -1707,12 +1711,17 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 - DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE); - DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, NONE); - DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, GIC_NONE, NONE); - DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, 0, 0, GIC_NONE, NONE); + DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, NONE); + DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, NONE); + DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, NONE); + DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, NONE); =20 DO_TEST_FULL("migrate-numa-unaligned", "stdio", 7, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM); =20 @@ -1756,10 +1765,12 @@ mymain(void) DO_TEST("cpu-host-model-vendor", NONE); DO_TEST_FULL("cpu-host-model-fallback", NULL, -1, FLAG_SKIP_LEGACY_CPUS, 0, - GIC_NONE, NONE); + GIC_NONE, + ARG_QEMU_CAPS, NONE); DO_TEST_FULL("cpu-host-model-nofallback", NULL, -1, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, - 0, GIC_NONE, NONE); + 0, GIC_NONE, + ARG_QEMU_CAPS, NONE); DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM); DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM); =20 @@ -2849,6 +2860,7 @@ mymain(void) QEMU_CAPS_PIIX3_USB_UHCI); DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", NULL, -1, 0, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, GIC_NONE, + ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_DEVICE_QEMU_XHCI); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574671210838.1170599875644; Thu, 14 Mar 2019 07:44:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32108307B497; Thu, 14 Mar 2019 14:44:29 +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 F38D860FD6; Thu, 14 Mar 2019 14:44:28 +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 A962F181A138; Thu, 14 Mar 2019 14:44:28 +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 x2EEiOus024505 for ; Thu, 14 Mar 2019 10:44:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6DA3760FDB; Thu, 14 Mar 2019 14:44:24 +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 0880660BE6; Thu, 14 Mar 2019 14:44:23 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:58 -0400 Message-Id: <4d2f36a09568251a2b9b81f28995cd2575b3cc6f.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 05/21] tests: qemuxml2argv: break apart testInitQEMUCaps 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 14 Mar 2019 14:44:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 393d2399fa..06a28178d0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -378,25 +378,6 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy) } =20 =20 -static int -testInitQEMUCaps(struct testInfo *info, - int gic) -{ - int ret =3D -1; - - if (!(info->qemuCaps =3D virQEMUCapsNew())) - goto cleanup; - - if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0) - goto cleanup; - - ret =3D 0; - - cleanup: - return ret; -} - - static int testUpdateQEMUCaps(const struct testInfo *info, virDomainObjPtr vm, @@ -840,7 +821,9 @@ mymain(void) static struct testInfo info =3D { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags,= \ }; \ - if (testInitQEMUCaps(&info, gic) < 0) \ + if (!(info.qemuCaps =3D 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; \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574680876279.3708920763778; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2482931028C5; Thu, 14 Mar 2019 14:44:39 +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 EC01317DC4; Thu, 14 Mar 2019 14:44:38 +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 A74263FAF5; Thu, 14 Mar 2019 14:44:38 +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 x2EEiPqg024513 for ; Thu, 14 Mar 2019 10:44:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BBC260FDB; Thu, 14 Mar 2019 14:44:25 +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 9AB2D60BE6; Thu, 14 Mar 2019 14:44:24 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:59 -0400 Message-Id: <68258937efce1bd675640af7088267d4131b2df7.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 06/21] tests: qemuxml2argv: handle gic with vaargs 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 14 Mar 2019 14:44:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This allows us to drop stub gic values from DO_TEST_FULL calls Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 06a28178d0..60df2c3a00 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -607,6 +607,7 @@ testCompareXMLToArgv(const void *data) =20 typedef enum { ARG_QEMU_CAPS =3D 1, + ARG_GIC, =20 ARG_END =3D QEMU_CAPS_LAST, } testInfoArgNames; @@ -625,6 +626,12 @@ testInfoSetArgs(struct testInfo *info, ...) virQEMUCapsSetVList(info->qemuCaps, argptr); break; =20 + case ARG_GIC: + if (testQemuCapsSetGIC(info->qemuCaps, + va_arg(argptr, int)) < 0) + goto cleanup; + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -816,15 +823,13 @@ mymain(void) DO_TEST_CAPS_FULL(name, 0, 0, ver) =20 # define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ - parseFlags, gic, ...) \ + parseFlags, ...) \ do { \ static struct testInfo info =3D { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags,= \ }; \ if (!(info.qemuCaps =3D 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; \ if (virTestRun("QEMU XML-2-ARGV " name, \ @@ -834,28 +839,29 @@ mymain(void) } while (0) =20 # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, \ + DO_TEST_FULL(name, NULL, -1, 0, 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, gic, \ + DO_TEST_FULL(name, NULL, -1, 0, 0, \ + ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ - 0, GIC_NONE, \ + 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_ERROR(name, ...) \ DO_TEST_FULL(name, NULL, -1, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ - 0, GIC_NONE, \ + 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ DO_TEST_FULL(name, NULL, -1, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ - parseFlags, GIC_NONE, \ + parseFlags, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define NONE QEMU_CAPS_LAST @@ -1694,16 +1700,16 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 - DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, + DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, GIC_NONE, + DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, GIC_NONE, + DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, 0, 0, GIC_NONE, + DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, 0, 0, ARG_QEMU_CAPS, NONE); =20 - DO_TEST_FULL("migrate-numa-unaligned", "stdio", 7, 0, 0, GIC_NONE, + DO_TEST_FULL("migrate-numa-unaligned", "stdio", 7, 0, 0, ARG_QEMU_CAPS, QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM); @@ -1748,11 +1754,10 @@ mymain(void) DO_TEST("cpu-host-model-vendor", NONE); DO_TEST_FULL("cpu-host-model-fallback", NULL, -1, FLAG_SKIP_LEGACY_CPUS, 0, - GIC_NONE, ARG_QEMU_CAPS, NONE); DO_TEST_FULL("cpu-host-model-nofallback", NULL, -1, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, - 0, GIC_NONE, + 0, ARG_QEMU_CAPS, NONE); DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM); DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM); @@ -2842,7 +2847,7 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_PIIX3_USB_UHCI); DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", NULL, -1, 0, - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, GIC_NONE, + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_NEC_USB_XHCI, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574676930282.30591454556054; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) 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 040683060FDA; Thu, 14 Mar 2019 14:44:35 +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 D009635F2; Thu, 14 Mar 2019 14:44:34 +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 8DAB8181A264; Thu, 14 Mar 2019 14:44:34 +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 x2EEiSc5024536 for ; Thu, 14 Mar 2019 10:44:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 716BB60FAB; Thu, 14 Mar 2019 14:44:28 +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 0122960FDC; Thu, 14 Mar 2019 14:44:25 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:00 -0400 Message-Id: <4ba5569ff35e3d3019b26120ea76f869d4502689.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 07/21] tests: qemuxml2argv: handle migrate* with varargs 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 14 Mar 2019 14:44:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This allows us to drop migrateFrom and migrateFd from DO_TEST_FULL Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 46 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 60df2c3a00..c6bd240c54 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -608,6 +608,8 @@ testCompareXMLToArgv(const void *data) typedef enum { ARG_QEMU_CAPS =3D 1, ARG_GIC, + ARG_MIGRATE_FROM, + ARG_MIGRATE_FD, =20 ARG_END =3D QEMU_CAPS_LAST, } testInfoArgNames; @@ -632,6 +634,14 @@ testInfoSetArgs(struct testInfo *info, ...) goto cleanup; break; =20 + case ARG_MIGRATE_FROM: + info->migrateFrom =3D va_arg(argptr, char *); + break; + + case ARG_MIGRATE_FD: + info->migrateFd =3D va_arg(argptr, int); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -822,11 +832,10 @@ mymain(void) # define DO_TEST_CAPS(name, ver) \ DO_TEST_CAPS_FULL(name, 0, 0, ver) =20 -# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ - parseFlags, ...) \ +# define DO_TEST_FULL(name, flags, parseFlags, ...) \ do { \ static struct testInfo info =3D { \ - name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags,= \ + name, NULL, NULL, NULL, -1, (flags), parseFlags, \ }; \ if (!(info.qemuCaps =3D virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -839,27 +848,27 @@ mymain(void) } while (0) =20 # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, \ + DO_TEST_FULL(name, 0, 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, \ + DO_TEST_FULL(name, 0, 0, \ ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_FAILURE(name, ...) \ - DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ + DO_TEST_FULL(name, FLAG_EXPECT_FAILURE, \ 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_ERROR(name, ...) \ - DO_TEST_FULL(name, NULL, -1, \ + DO_TEST_FULL(name, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ - DO_TEST_FULL(name, NULL, -1, \ + DO_TEST_FULL(name, \ FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ parseFlags, \ ARG_QEMU_CAPS, __VA_ARGS__) @@ -1700,16 +1709,21 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 - DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, + DO_TEST_FULL("restore-v2", 0, 0, + ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", "stdio", 7, 0, 0, + DO_TEST_FULL("restore-v2-fd", 0, 0, + ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", "fd:7", 7, 0, 0, + DO_TEST_FULL("restore-v2-fd", 0, 0, + ARG_MIGRATE_FROM, "fd:7", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, 0, 0, + DO_TEST_FULL("migrate", 0, 0, + ARG_MIGRATE_FROM, "tcp:10.0.0.1:5000", ARG_QEMU_CAPS, NONE); =20 - DO_TEST_FULL("migrate-numa-unaligned", "stdio", 7, 0, 0, + DO_TEST_FULL("migrate-numa-unaligned", 0, 0, + ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM); @@ -1752,10 +1766,10 @@ mymain(void) DO_TEST("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("cpu-host-model", NONE); DO_TEST("cpu-host-model-vendor", NONE); - DO_TEST_FULL("cpu-host-model-fallback", NULL, -1, + DO_TEST_FULL("cpu-host-model-fallback", FLAG_SKIP_LEGACY_CPUS, 0, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("cpu-host-model-nofallback", NULL, -1, + DO_TEST_FULL("cpu-host-model-nofallback", FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, 0, ARG_QEMU_CAPS, NONE); @@ -2846,7 +2860,7 @@ mymain(void) DO_TEST("ppc64-usb-controller-legacy", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_PIIX3_USB_UHCI); - DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", NULL, -1, 0, + DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", 0, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 15525746862541020.8061902263966; Thu, 14 Mar 2019 07:44:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2F102DA988; Thu, 14 Mar 2019 14:44:44 +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 900AD6E3E7; Thu, 14 Mar 2019 14:44:44 +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 5143A3FA4A; Thu, 14 Mar 2019 14:44:44 +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 x2EEiT9A024544 for ; Thu, 14 Mar 2019 10:44:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 13BF060FDB; Thu, 14 Mar 2019 14:44:29 +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 A029E60FAB; Thu, 14 Mar 2019 14:44:28 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:01 -0400 Message-Id: <9180674e3de344c4e02ecd79952ac8d6b9e0cc3f.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 08/21] tests: qemuxml2argv: handle flags with varargs 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 14 Mar 2019 14:44:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This allows us to drop flags from DO_TEST_FULL Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c6bd240c54..bb3d53070f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -610,6 +610,7 @@ typedef enum { ARG_GIC, ARG_MIGRATE_FROM, ARG_MIGRATE_FD, + ARG_FLAGS, =20 ARG_END =3D QEMU_CAPS_LAST, } testInfoArgNames; @@ -642,6 +643,10 @@ testInfoSetArgs(struct testInfo *info, ...) info->migrateFd =3D va_arg(argptr, int); break; =20 + case ARG_FLAGS: + info->flags =3D va_arg(argptr, int); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -832,10 +837,10 @@ mymain(void) # define DO_TEST_CAPS(name, ver) \ DO_TEST_CAPS_FULL(name, 0, 0, ver) =20 -# define DO_TEST_FULL(name, flags, parseFlags, ...) \ +# define DO_TEST_FULL(name, parseFlags, ...) \ do { \ static struct testInfo info =3D { \ - name, NULL, NULL, NULL, -1, (flags), parseFlags, \ + name, NULL, NULL, NULL, -1, 0, parseFlags, \ }; \ if (!(info.qemuCaps =3D virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -848,29 +853,30 @@ mymain(void) } while (0) =20 # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, 0, 0, \ + DO_TEST_FULL(name, 0, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, 0, 0, \ + DO_TEST_FULL(name, 0, \ ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_FAILURE(name, ...) \ - DO_TEST_FULL(name, FLAG_EXPECT_FAILURE, \ + DO_TEST_FULL(name, \ 0, \ + ARG_FLAGS, FLAG_EXPECT_FAILURE, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_ERROR(name, ...) \ DO_TEST_FULL(name, \ - FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ 0, \ + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ DO_TEST_FULL(name, \ - FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ parseFlags, \ + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define NONE QEMU_CAPS_LAST @@ -1709,20 +1715,20 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 - DO_TEST_FULL("restore-v2", 0, 0, + DO_TEST_FULL("restore-v2", 0, ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", 0, 0, + DO_TEST_FULL("restore-v2-fd", 0, ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", 0, 0, + DO_TEST_FULL("restore-v2-fd", 0, ARG_MIGRATE_FROM, "fd:7", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("migrate", 0, 0, + DO_TEST_FULL("migrate", 0, ARG_MIGRATE_FROM, "tcp:10.0.0.1:5000", ARG_QEMU_CAPS, NONE); =20 - DO_TEST_FULL("migrate-numa-unaligned", 0, 0, + DO_TEST_FULL("migrate-numa-unaligned", 0, ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, QEMU_CAPS_NUMA, @@ -1767,11 +1773,12 @@ mymain(void) DO_TEST("cpu-host-model", NONE); DO_TEST("cpu-host-model-vendor", NONE); DO_TEST_FULL("cpu-host-model-fallback", - FLAG_SKIP_LEGACY_CPUS, 0, + 0, + ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS, ARG_QEMU_CAPS, NONE); DO_TEST_FULL("cpu-host-model-nofallback", - FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, 0, + ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, ARG_QEMU_CAPS, NONE); DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM); DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM); @@ -2860,7 +2867,7 @@ mymain(void) DO_TEST("ppc64-usb-controller-legacy", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_PIIX3_USB_UHCI); - DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", 0, + DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574690203223.43557898722577; Thu, 14 Mar 2019 07:44:50 -0700 (PDT) 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 71826307B482; Thu, 14 Mar 2019 14:44:48 +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 4AB505DD93; Thu, 14 Mar 2019 14:44:48 +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 020B53F7D9; Thu, 14 Mar 2019 14:44:48 +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 x2EEiXck024567 for ; Thu, 14 Mar 2019 10:44:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 31CA561084; Thu, 14 Mar 2019 14:44:33 +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 9750760FE0; Thu, 14 Mar 2019 14:44:29 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:02 -0400 Message-Id: <22a08c100f4842b3a9b5c862f00f48eea1a9c5f1.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 09/21] tests: qemuxml2argv: handle parseFlags with varargs 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 14 Mar 2019 14:44:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This allows us to drop parseFlags from DO_TEST_FULL Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index bb3d53070f..070f7f0a05 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -611,6 +611,7 @@ typedef enum { ARG_MIGRATE_FROM, ARG_MIGRATE_FD, ARG_FLAGS, + ARG_PARSEFLAGS, =20 ARG_END =3D QEMU_CAPS_LAST, } testInfoArgNames; @@ -647,6 +648,10 @@ testInfoSetArgs(struct testInfo *info, ...) info->flags =3D va_arg(argptr, int); break; =20 + case ARG_PARSEFLAGS: + info->parseFlags =3D va_arg(argptr, int); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -837,10 +842,10 @@ mymain(void) # define DO_TEST_CAPS(name, ver) \ DO_TEST_CAPS_FULL(name, 0, 0, ver) =20 -# define DO_TEST_FULL(name, parseFlags, ...) \ +# define DO_TEST_FULL(name, ...) \ do { \ static struct testInfo info =3D { \ - name, NULL, NULL, NULL, -1, 0, parseFlags, \ + name, NULL, NULL, NULL, -1, 0, 0, \ }; \ if (!(info.qemuCaps =3D virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -853,29 +858,27 @@ mymain(void) } while (0) =20 # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, 0, \ + DO_TEST_FULL(name, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, 0, \ + DO_TEST_FULL(name, \ ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, \ - 0, \ ARG_FLAGS, FLAG_EXPECT_FAILURE, \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_ERROR(name, ...) \ DO_TEST_FULL(name, \ - 0, \ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ ARG_QEMU_CAPS, __VA_ARGS__) =20 # define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ DO_TEST_FULL(name, \ - parseFlags, \ + ARG_PARSEFLAGS, parseFlags, \ ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ ARG_QEMU_CAPS, __VA_ARGS__) =20 @@ -1715,20 +1718,20 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); =20 - DO_TEST_FULL("restore-v2", 0, + DO_TEST_FULL("restore-v2", ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", 0, + DO_TEST_FULL("restore-v2-fd", ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("restore-v2-fd", 0, + DO_TEST_FULL("restore-v2-fd", ARG_MIGRATE_FROM, "fd:7", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); - DO_TEST_FULL("migrate", 0, + DO_TEST_FULL("migrate", ARG_MIGRATE_FROM, "tcp:10.0.0.1:5000", ARG_QEMU_CAPS, NONE); =20 - DO_TEST_FULL("migrate-numa-unaligned", 0, + DO_TEST_FULL("migrate-numa-unaligned", ARG_MIGRATE_FROM, "stdio", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, QEMU_CAPS_NUMA, @@ -1773,11 +1776,9 @@ mymain(void) DO_TEST("cpu-host-model", NONE); DO_TEST("cpu-host-model-vendor", NONE); DO_TEST_FULL("cpu-host-model-fallback", - 0, ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS, ARG_QEMU_CAPS, NONE); DO_TEST_FULL("cpu-host-model-nofallback", - 0, ARG_FLAGS, FLAG_SKIP_LEGACY_CPUS | FLAG_EXPECT_FAILURE, ARG_QEMU_CAPS, NONE); DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM); @@ -2868,7 +2869,7 @@ mymain(void) QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_PIIX3_USB_UHCI); DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_NEC_USB_XHCI, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574695114294.0843390368743; Thu, 14 Mar 2019 07:44:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07303301BEE7; 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 756745D75D; 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 0B03F181A264; 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 x2EEiXc0024572 for ; Thu, 14 Mar 2019 10:44:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id C49B260FE0; Thu, 14 Mar 2019 14:44:33 +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 607DB6107F; Thu, 14 Mar 2019 14:44:33 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:03 -0400 Message-Id: <94c3d1c16de33499139b507becba68d904646f90.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 10/21] tests: qemuxml2argv: remove DO_TEST_PARSE_FLAGS_ERROR 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 14 Mar 2019 14:44:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It only has one caller. Just use DO_TEST_FULL Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 070f7f0a05..1ce8bade48 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -876,12 +876,6 @@ mymain(void) ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ ARG_QEMU_CAPS, __VA_ARGS__) =20 -# define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ - DO_TEST_FULL(name, \ - ARG_PARSEFLAGS, parseFlags, \ - ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE,= \ - ARG_QEMU_CAPS, __VA_ARGS__) - # define NONE QEMU_CAPS_LAST =20 /* Unset or set all envvars here that are copied in qemudBuildCommandL= ine @@ -2887,9 +2881,10 @@ mymain(void) /* VM XML has invalid arch/ostype/virttype combo, but the SKIP flag * will avoid the error. Still, we expect qemu driver to complain about * missing machine error, and not crash */ - DO_TEST_PARSE_FLAGS_ERROR("missing-machine", - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, - NONE); + DO_TEST_FULL("missing-machine", + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE, + ARG_QEMU_CAPS, NONE); =20 DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574680520739.013912101921; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE64B9B33E; Thu, 14 Mar 2019 14:44:38 +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 A305F60FDD; Thu, 14 Mar 2019 14:44:38 +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 617763FB15; Thu, 14 Mar 2019 14:44:38 +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 x2EEiYnU024577 for ; Thu, 14 Mar 2019 10:44:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6819E61090; Thu, 14 Mar 2019 14:44:34 +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 F2F786107F; Thu, 14 Mar 2019 14:44:33 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:04 -0400 Message-Id: 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 11/21] tests: qemuxml2argv: remove unused DO_TEST_CAPS* macros 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 14 Mar 2019 14:44:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" They are potentially useful at the moment, but we will be making things much more flexible Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1ce8bade48..130ab29d6e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -832,16 +832,6 @@ mymain(void) # define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_PARSE_ERROR,= 0) =20 -/** - * The following test macros should be used only in cases when the tests r= equire - * testing of some non-standard combination of capability flags - */ -# define DO_TEST_CAPS_FULL(name, flags, parseFlags, ver) \ - DO_TEST_CAPS_ARCH(name, NULL, flags, parseFlags, GIC_NONE, "x86_64", v= er) - -# define DO_TEST_CAPS(name, ver) \ - DO_TEST_CAPS_FULL(name, 0, 0, ver) - # define DO_TEST_FULL(name, ...) \ do { \ static struct testInfo info =3D { \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574698062374.06254793683786; Thu, 14 Mar 2019 07:44:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72B5D3004414; Thu, 14 Mar 2019 14:44:56 +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 463CB6BF60; Thu, 14 Mar 2019 14:44:56 +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 EBC0D3F5CE; Thu, 14 Mar 2019 14:44:55 +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 x2EEiZ1Z024587 for ; Thu, 14 Mar 2019 10:44:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6D0DB60FDD; Thu, 14 Mar 2019 14:44:35 +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 C577660FE1; Thu, 14 Mar 2019 14:44:34 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:05 -0400 Message-Id: <44679b726ca9fe45757ee8c70a869b9d2a8720f9.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 12/21] tests: qemuxml2argv: add a comment separating DO_TEST* macros 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 14 Mar 2019 14:44:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 130ab29d6e..b555166e82 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -832,6 +832,9 @@ mymain(void) # define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_PARSE_ERROR,= 0) =20 + +/* All the following macros require an explicit QEMU_CAPS_* list + * at the end of the argument list, or the NONE placeholder */ # define DO_TEST_FULL(name, ...) \ do { \ static struct testInfo info =3D { \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574684364601.365422145349; Thu, 14 Mar 2019 07:44:44 -0700 (PDT) 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 9DBEB30017B5; Thu, 14 Mar 2019 14:44:42 +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 70D1017C65; Thu, 14 Mar 2019 14:44:42 +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 2A159181A266; Thu, 14 Mar 2019 14:44:42 +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 x2EEiaD3024592 for ; Thu, 14 Mar 2019 10:44:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 401EC60BE6; Thu, 14 Mar 2019 14:44:36 +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 CD3076B483; Thu, 14 Mar 2019 14:44:35 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:06 -0400 Message-Id: <1143c158aef329a7d52f26d7bd9e2cbc42f9ef29.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 13/21] tests: qemuxml2argv: remove unused CAPS migrateFrom 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 14 Mar 2019 14:44:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b555166e82..7708e8db70 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -786,11 +786,11 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define DO_TEST_CAPS_INTERNAL(name, suffix, migrateFrom, flags, parseFlag= s, \ +# define DO_TEST_CAPS_INTERNAL(name, suffix, flags, parseFlags, \ arch, capsfile, stripmachinealiases) \ do { \ static struct testInfo info =3D { \ - name, "." suffix, NULL, migrateFrom, migrateFrom ? 7 : -1,\ + name, "." suffix, NULL, NULL, -1,\ (flags | FLAG_REAL_CAPS), parseFlags, \ }; \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ @@ -807,7 +807,7 @@ mymain(void) # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" =20 # define DO_TEST_CAPS_ARCH_VER_FULL(name, flags, parseFlags, arch, ver) \ - DO_TEST_CAPS_INTERNAL(name, arch "-" ver, NULL, flags, parseFlags, \ + DO_TEST_CAPS_INTERNAL(name, arch "-" ver, flags, parseFlags, \ arch, TEST_CAPS_PATH ver "." arch ".xml", false) =20 # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ @@ -817,7 +817,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) =20 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, flags, parseFlags) \ - DO_TEST_CAPS_INTERNAL(name, arch "-latest", NULL, flags, parseFlags, a= rch, \ + DO_TEST_CAPS_INTERNAL(name, arch "-latest", flags, parseFlags, arch, \ virHashLookup(capslatest, arch), true) =20 # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574702152437.96659700467364; Thu, 14 Mar 2019 07:45:02 -0700 (PDT) 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 3C1612F3695; Thu, 14 Mar 2019 14:45:00 +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 0B37728551; Thu, 14 Mar 2019 14:45:00 +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 BDCEB181A270; Thu, 14 Mar 2019 14:44:59 +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 x2EEiiBN024627 for ; Thu, 14 Mar 2019 10:44:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3C1C60FAB; Thu, 14 Mar 2019 14:44:44 +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 128DD60FE1; Thu, 14 Mar 2019 14:44:36 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:07 -0400 Message-Id: <1b8192f82c70865feaec767456508eed2263d022.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 14/21] tests: qemuxml2argv: use varargs for CAPS flags 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.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.29]); Thu, 14 Mar 2019 14:45:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7708e8db70..176e4eff3e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -786,18 +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, suffix, flags, parseFlags, \ - arch, capsfile, stripmachinealiases) \ +# define DO_TEST_CAPS_INTERNAL(name, suffix, \ + arch, capsfile, stripmachinealiases, ...) \ do { \ static struct testInfo info =3D { \ - name, "." suffix, NULL, NULL, -1,\ - (flags | FLAG_REAL_CAPS), parseFlags, \ + name, "." suffix, NULL, NULL, -1, 0, 0, \ }; \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ return EXIT_FAILURE; \ if (stripmachinealiases) \ virQEMUCapsStripMachineAliases(info.qemuCaps); \ + if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ + return EXIT_FAILURE; \ + info.flags |=3D FLAG_REAL_CAPS; \ if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ @@ -806,31 +808,35 @@ mymain(void) =20 # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" =20 -# define DO_TEST_CAPS_ARCH_VER_FULL(name, flags, parseFlags, arch, ver) \ - DO_TEST_CAPS_INTERNAL(name, arch "-" ver, flags, parseFlags, \ - arch, TEST_CAPS_PATH ver "." arch ".xml", false) +# define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \ + DO_TEST_CAPS_INTERNAL(name, arch "-" ver, \ + arch, 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, 0, 0, arch, ver) + DO_TEST_CAPS_ARCH_VER_FULL(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, flags, parseFlags) \ - DO_TEST_CAPS_INTERNAL(name, arch "-latest", flags, parseFlags, arch, \ - virHashLookup(capslatest, arch), true) +# define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \ + DO_TEST_CAPS_INTERNAL(name, arch "-latest", arch, \ + virHashLookup(capslatest, arch), true, \ + __VA_ARGS__) =20 # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ - DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, 0, 0) + DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END) =20 # define DO_TEST_CAPS_LATEST(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "x86_64") =20 # define DO_TEST_CAPS_LATEST_FAILURE(name) \ - DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_FAILURE, 0) + DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \ + ARG_FLAGS, FLAG_EXPECT_FAILURE) =20 # define DO_TEST_CAPS_LATEST_PARSE_ERROR(name) \ - DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", FLAG_EXPECT_PARSE_ERROR,= 0) + DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \ + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR) =20 =20 /* All the following macros require an explicit QEMU_CAPS_* list --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574688962450.5038809666944; Thu, 14 Mar 2019 07:44:48 -0700 (PDT) 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 EF13411BB7B; Thu, 14 Mar 2019 14:44:46 +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 B06991001DEF; Thu, 14 Mar 2019 14:44:46 +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 6E57F3FA4C; Thu, 14 Mar 2019 14:44:46 +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 x2EEijkh024632 for ; Thu, 14 Mar 2019 10:44:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 756CA60FE5; Thu, 14 Mar 2019 14:44:45 +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 0E5AB60F89; Thu, 14 Mar 2019 14:44:44 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:08 -0400 Message-Id: <26cc33145b6f80854e070505d048341219d05a8b.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 15/21] tests: qemuxml2argv: remove full testInfo initialization 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.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.38]); Thu, 14 Mar 2019 14:44:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Only initialize the fields that are passed in Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 176e4eff3e..b1c18c6c09 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -786,11 +786,12 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define DO_TEST_CAPS_INTERNAL(name, suffix, \ +# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \ arch, capsfile, stripmachinealiases, ...) \ do { \ static struct testInfo info =3D { \ - name, "." suffix, NULL, NULL, -1, 0, 0, \ + .name =3D _name, \ + .suffix =3D "." _suffix, \ }; \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ @@ -800,7 +801,7 @@ mymain(void) if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ info.flags |=3D FLAG_REAL_CAPS; \ - if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \ + if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ virObjectUnref(info.qemuCaps); \ @@ -841,16 +842,16 @@ mymain(void) =20 /* All the following macros require an explicit QEMU_CAPS_* list * at the end of the argument list, or the NONE placeholder */ -# define DO_TEST_FULL(name, ...) \ +# define DO_TEST_FULL(_name, ...) \ do { \ static struct testInfo info =3D { \ - name, NULL, NULL, NULL, -1, 0, 0, \ + .name =3D _name, \ }; \ if (!(info.qemuCaps =3D virQEMUCapsNew())) \ return EXIT_FAILURE; \ if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) <= 0) \ return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " name, \ + if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ virObjectUnref(info.qemuCaps); \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 155257469113633.9480700540945; Thu, 14 Mar 2019 07:44:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CD77C0AC351; Thu, 14 Mar 2019 14:44:49 +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 E6E3A6A97B; Thu, 14 Mar 2019 14:44:48 +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 9D574181A26B; Thu, 14 Mar 2019 14:44:48 +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 x2EEikrp024637 for ; Thu, 14 Mar 2019 10:44:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1915260FD6; Thu, 14 Mar 2019 14:44:46 +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 A496C60F89; Thu, 14 Mar 2019 14:44:45 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:09 -0400 Message-Id: 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 16/21] tests: qemuxml2argv: centralize CAPS suffix building 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.13 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:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b1c18c6c09..4b34bbcb63 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -786,12 +786,12 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \ - arch, capsfile, stripmachinealiases, ...) \ +# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, \ + capsfile, stripmachinealiases, ...) \ do { \ static struct testInfo info =3D { \ .name =3D _name, \ - .suffix =3D "." _suffix, \ + .suffix =3D "." arch "-" ver, \ }; \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ @@ -801,7 +801,7 @@ mymain(void) if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ info.flags |=3D FLAG_REAL_CAPS; \ - if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \ + if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ virObjectUnref(info.qemuCaps); \ @@ -810,8 +810,8 @@ mymain(void) # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" =20 # define DO_TEST_CAPS_ARCH_VER_FULL(name, arch, ver, ...) \ - DO_TEST_CAPS_INTERNAL(name, arch "-" ver, \ - arch, TEST_CAPS_PATH ver "." arch ".xml", false,= \ + 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) \ @@ -821,7 +821,7 @@ mymain(void) 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", arch, \ + DO_TEST_CAPS_INTERNAL(name, arch, "latest", \ virHashLookup(capslatest, arch), true, \ __VA_ARGS__) =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 From nobody Wed Apr 24 09:44:40 2024 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 1552574707264449.4873514421737; Thu, 14 Mar 2019 07:45:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58B3D67BCE; Thu, 14 Mar 2019 14:45:05 +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 210AF6BF71; Thu, 14 Mar 2019 14:45:05 +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 AFC933D38A; Thu, 14 Mar 2019 14:45:04 +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 x2EEiosp024678 for ; Thu, 14 Mar 2019 10:44:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D12860FE5; Thu, 14 Mar 2019 14:44:50 +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 9284A60FD6; Thu, 14 Mar 2019 14:44:48 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:11 -0400 Message-Id: <7ce3cbe2cb0f11241884f5ca15f4f84d0585ce2f.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 18/21] tests: qemuxml2argv: add testInfoClear 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 14 Mar 2019 14:45:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is closer to the pattern of qemuxml2xml tests, and will make things easier if we extend testInfo to contain more freeable data Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 496e33f4e5..813871d6b8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -665,6 +665,12 @@ testInfoSetArgs(struct testInfo *info, ...) return ret; } =20 +static void +testInfoClear(struct testInfo *info) +{ + virObjectUnref(info->qemuCaps); +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" =20 static int @@ -811,10 +817,9 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) =20 - # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) =20 @@ -853,7 +858,7 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) =20 # define DO_TEST(name, ...) \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574713378763.4357672035875; Thu, 14 Mar 2019 07:45:13 -0700 (PDT) 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 7A5CE30A187A; Thu, 14 Mar 2019 14:45:11 +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 37A015D9C8; Thu, 14 Mar 2019 14:45:11 +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 C21A5181A274; Thu, 14 Mar 2019 14:45:10 +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 x2EEj9Zd024868 for ; Thu, 14 Mar 2019 10:45:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55793610CA; Thu, 14 Mar 2019 14:45:09 +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 4D68F61084; Thu, 14 Mar 2019 14:44:50 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:12 -0400 Message-Id: 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 19/21] tests: qemuxml2argv: move DO_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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 14 Mar 2019 14:45:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Move DO_TEST* qemuCaps init into testInfoSetArgs. This is a step towards unifying the different test macro implementations Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 813871d6b8..ff74892944 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -621,19 +621,21 @@ testInfoSetArgs(struct testInfo *info, ...) { va_list argptr; testInfoArgNames argname; + virQEMUCapsPtr qemuCaps =3D NULL; + int gic =3D GIC_NONE; int ret =3D -1; =20 va_start(argptr, info); while ((argname =3D va_arg(argptr, int)) < ARG_END) { switch (argname) { case ARG_QEMU_CAPS: - virQEMUCapsSetVList(info->qemuCaps, argptr); + if (qemuCaps || !(qemuCaps =3D virQEMUCapsNew())) + goto cleanup; + virQEMUCapsSetVList(qemuCaps, argptr); break; =20 case ARG_GIC: - if (testQemuCapsSetGIC(info->qemuCaps, - va_arg(argptr, int)) < 0) - goto cleanup; + gic =3D va_arg(argptr, int); break; =20 case ARG_MIGRATE_FROM: @@ -659,8 +661,20 @@ testInfoSetArgs(struct testInfo *info, ...) } } =20 + if (!info->qemuCaps) { + if (!qemuCaps) { + fprintf(stderr, "No qemuCaps generated\n"); + goto cleanup; + } + VIR_STEAL_PTR(info->qemuCaps, qemuCaps); + } + + if (gic && testQemuCapsSetGIC(info->qemuCaps, gic) < 0) + goto cleanup; + ret =3D 0; cleanup: + virObjectUnref(qemuCaps); va_end(argptr); return ret; } @@ -851,8 +865,6 @@ mymain(void) static struct testInfo info =3D { \ .name =3D _name, \ }; \ - if (!(info.qemuCaps =3D virQEMUCapsNew())) \ - return EXIT_FAILURE; \ if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) <= 0) \ return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " _name, \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574733499308.59404744924893; Thu, 14 Mar 2019 07:45:33 -0700 (PDT) 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 9D92B30018CB; Thu, 14 Mar 2019 14:45:31 +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 6C30027191; Thu, 14 Mar 2019 14:45:31 +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 27D1D181A13E; Thu, 14 Mar 2019 14:45:31 +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 x2EEjTlj025012 for ; Thu, 14 Mar 2019 10:45:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9750E60FE6; Thu, 14 Mar 2019 14:45:29 +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 F248A60F87; Thu, 14 Mar 2019 14:45:09 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:13 -0400 Message-Id: <80f40cc264dfc120e97e8a265be8f2f1d626112e.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 20/21] 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: , Content-Transfer-Encoding: quoted-printable 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.46]); Thu, 14 Mar 2019 14:45:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 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 | 68 +++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ff74892944..d5e02c26d8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -605,6 +605,8 @@ testCompareXMLToArgv(const void *data) return ret; } =20 +# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" + typedef enum { ARG_QEMU_CAPS =3D 1, ARG_GIC, @@ -612,20 +614,25 @@ typedef enum { ARG_MIGRATE_FD, ARG_FLAGS, ARG_PARSEFLAGS, + ARG_CAPS_ARCH, + ARG_CAPS_VER, =20 ARG_END =3D QEMU_CAPS_LAST, } testInfoArgNames; =20 static int -testInfoSetArgs(struct testInfo *info, ...) +testInfoSetArgs(struct testInfo *info, virHashTablePtr capslatest, ...) { va_list argptr; testInfoArgNames argname; virQEMUCapsPtr qemuCaps =3D NULL; int gic =3D GIC_NONE; int ret =3D -1; + char *capsarch =3D NULL; + char *capsver =3D NULL; + VIR_AUTOFREE(char *) capsfile =3D NULL; =20 - va_start(argptr, info); + va_start(argptr, capslatest); while ((argname =3D va_arg(argptr, int)) < ARG_END) { switch (argname) { case ARG_QEMU_CAPS: @@ -654,6 +661,14 @@ testInfoSetArgs(struct testInfo *info, ...) info->parseFlags =3D va_arg(argptr, int); break; =20 + case ARG_CAPS_ARCH: + capsarch =3D va_arg(argptr, char *); + break; + + case ARG_CAPS_VER: + capsver =3D va_arg(argptr, char *); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -661,13 +676,33 @@ testInfoSetArgs(struct testInfo *info, ...) } } =20 - if (!info->qemuCaps) { - if (!qemuCaps) { - fprintf(stderr, "No qemuCaps generated\n"); + if (!qemuCaps && capsarch && capsver) { + bool stripmachinealiases =3D false; + + if (STREQ(capsver, "latest")) { + if (VIR_STRDUP(capsfile, virHashLookup(capslatest, capsarch)) = < 0) + goto cleanup; + stripmachinealiases =3D true; + } else if (virAsprintf(&capsfile, + TEST_CAPS_PATH "%s.%s.xml", + capsver, capsarch) < 0) { goto cleanup; } - VIR_STEAL_PTR(info->qemuCaps, qemuCaps); + + if (!(qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromString= (capsarch), + capsfile))) + goto cleanup; + + if (stripmachinealiases) + virQEMUCapsStripMachineAliases(qemuCaps); + info->flags |=3D FLAG_REAL_CAPS; + } + + if (!qemuCaps) { + fprintf(stderr, "No qemuCaps generated\n"); + goto cleanup; } + VIR_STEAL_PTR(info->qemuCaps, qemuCaps); =20 if (gic && testQemuCapsSetGIC(info->qemuCaps, gic) < 0) goto cleanup; @@ -806,7 +841,6 @@ mymain(void) * the test cases should be forked using DO_TEST_CAPS_VER with the appropr= iate * version. */ -# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" =20 # define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ do { \ @@ -814,20 +848,11 @@ mymain(void) .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; \ - 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 |=3D FLAG_REAL_CAPS; \ if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ @@ -865,7 +890,8 @@ mymain(void) static struct testInfo info =3D { \ .name =3D _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) \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 09:44:40 2024 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 1552574741579856.6276491713583; Thu, 14 Mar 2019 07:45:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7A9D2588F; Thu, 14 Mar 2019 14:45:39 +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 752725D73F; Thu, 14 Mar 2019 14:45:39 +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 32D2E3D396; Thu, 14 Mar 2019 14:45:39 +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 x2EEjcBH025075 for ; Thu, 14 Mar 2019 10:45:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 670EE60FE6; Thu, 14 Mar 2019 14:45:38 +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 9C657619BE; Thu, 14 Mar 2019 14:45:29 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:14 -0400 Message-Id: <32ac0ed1c8062c3cf0dc52f1c326d0495ce389c0.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 21/21] tests: qemuxml2argv: add 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Mar 2019 14:45:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Base macro to unify the actual testCompareXMLToArgv test calls Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d5e02c26d8..a901582ef6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -842,23 +842,27 @@ mymain(void) * version. */ =20 -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ +# define TEST_INTERNAL(_name, _suffix, ...) \ do { \ static struct testInfo info =3D { \ .name =3D _name, \ - .suffix =3D "." arch "-" ver, \ + .suffix =3D _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 =3D -1; \ testInfoClear(&info); \ } while (0) =20 +# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ + 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) =20 @@ -885,19 +889,8 @@ mymain(void) =20 /* All the following macros require an explicit QEMU_CAPS_* list * at the end of the argument list, or the NONE placeholder */ -# define DO_TEST_FULL(_name, ...) \ - do { \ - static struct testInfo info =3D { \ - .name =3D _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 =3D -1; \ - testInfoClear(&info); \ - } while (0) +# define DO_TEST_FULL(name, ...) \ + TEST_INTERNAL(name, "", __VA_ARGS__, QEMU_CAPS_LAST) =20 # define DO_TEST(name, ...) \ DO_TEST_FULL(name, \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list