From patchwork Thu Mar 14 14:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160347 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595182jad; Thu, 14 Mar 2019 07:44:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7HeaI/ofVyDzY+NVOUYlvDaWhm/HUbVgzTXMpJTdJhwV4Gfp+le5Fq78DWkuJDlUniSNq X-Received: by 2002:ac8:2447:: with SMTP id d7mr3695382qtd.162.1552574689883; Thu, 14 Mar 2019 07:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574689; cv=none; d=google.com; s=arc-20160816; b=Tzrzg2mN2KHI8M8TCvLSk+fRiyrDm5Jr5OmClHtBYK4MmS5cwBqN/tdqd2ADobfi6E JAWI8A5U8Ktzm50wCrPcnWP9EWjVXqWO0RkqKoGaFRRAna1OAFlL0yL/Ei3ZjYQ9J3tw sSosnBCigu2kVd4v73RcKLCySaKBF+QGGrwMw6mvm1pTnNrDLK+0NQvfiSbP27xXnof4 xBOKDWXrbwRKZIKtEYusFzCTV5JNY72Ep52FgTURau8WFbKMJMNhUbFBORTTYnWlmTMO k7ZLUiPrndrX1B4JaDzs1GmNf3+7FOSKAAI+ly90REYDo1rYBGcscJBfrNEu0F+TwDwv AZig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=AvITt+//Oe2dIW8tNLF6KGUV7mcaAikCPOl1fzJnbto=; b=E2UBZmoJCrAgG2T/6xtPaZV5glEIV6zl7iGtLKjCJRsAZ+5Vh9xyRD9M6PbslMGQtt clVWEjsAO58kI4C5YpBa36m7bs6vw6RljprcWn9CUdLT5HtqISoJYPzSI8QYTMW9uxTN vaxJI+3RZVxCypym8xdRVjb9iNahPts7BL5e7hlnY1kpFszJFirsMOvxTAING7LfmsAv fIrnhgrQiLtNUvgBV9oADp3DTnztXLKwgJFEV/FirrCjhZfD3MVYaJyjxDvf/vK31U4m 5NV/bgcB6wefb/CCzquySfooasIZUqLHcDKgTHLpC2oKEVHISbYz9eXYr3xgoFhgmnOw VqlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q189si3595770qkd.185.2019.03.14.07.44.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 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) Delivered-To: libvirt-list@redhat.com 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: , 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) This allows us to drop parseFlags from DO_TEST_FULL Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 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, ARG_END = QEMU_CAPS_LAST, } testInfoArgNames; @@ -647,6 +648,10 @@ testInfoSetArgs(struct testInfo *info, ...) info->flags = va_arg(argptr, int); break; + case ARG_PARSEFLAGS: + info->parseFlags = 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) -# define DO_TEST_FULL(name, parseFlags, ...) \ +# define DO_TEST_FULL(name, ...) \ do { \ static struct testInfo info = { \ - name, NULL, NULL, NULL, -1, 0, parseFlags, \ + name, NULL, NULL, NULL, -1, 0, 0, \ }; \ if (!(info.qemuCaps = virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -853,29 +858,27 @@ mymain(void) } while (0) # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, 0, \ + DO_TEST_FULL(name, \ ARG_QEMU_CAPS, __VA_ARGS__) # define DO_TEST_GIC(name, gic, ...) \ - DO_TEST_FULL(name, 0, \ + DO_TEST_FULL(name, \ ARG_GIC, gic, \ ARG_QEMU_CAPS, __VA_ARGS__) # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, \ - 0, \ ARG_FLAGS, FLAG_EXPECT_FAILURE, \ ARG_QEMU_CAPS, __VA_ARGS__) # 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__) # 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__) @@ -1715,20 +1718,20 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); - 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); - 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,