From nobody Sun Feb 8 10:21:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 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