From patchwork Thu Mar 14 14:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160338 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594955jad; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzov2l357tk/gnjPdJ25lHiXrFPHcykaqAKaK/C8Dz/ufNSUy+zgMbxpsBnb9NMS7Q4urWD X-Received: by 2002:a0c:abcc:: with SMTP id k12mr4128349qvb.218.1552574676320; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574676; cv=none; d=google.com; s=arc-20160816; b=xGrMm8JjGbI9uZrf9gTMjjmTIuYlkbUl+71WB69r+5AhXDpO6828ZXl5F5oQ6FLx/4 WV0DzLtJgJCsGHa4neJ+zG+Xu6hwMlraqeoz+cbGGJik8cO7kozV1J6fAhIvWa/LGRf/ SO0xKjMXODFyJLkQ2L95wAnnFgDNuYcHAAAuF3UNuM40RCvYkUJdkI2ylDJPgsyEvxIV 44rUjOnHR3WxtfpAFE7n3PDLHx4AHtqPRC/dFV/yWgdcPpSFL4zl33jZwoQi5iXpi0dr aYtt+foesNn/SRX/ehoQD9n0NFb8+L2uOinTf6EzAJ53rcdYe1Yhf5dPeqt9DMkoERf0 5/YQ== 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=vnUW5637Hzqhm/Pj7Rk7lrSANcquUx647H2FVXO4aok=; b=zhj678mGALKeWRqApZZNp9818KYnPxn5JyRNJXHU+3yO1mBrpeG4lSb0o60o3x1p02 TkbPUePVWSjGXERQDZHPLZ/8JaX9uX7TbaWoqOhOw4h952LCmetwmN8llnYuWYg8GtkG Ujo544cF5KW6sxkgJzTGIep+2mDUfc5m+dySLZlVr7DeJMYNXulNdpJsvZgyMGTjh0s3 5XGP087nCKx394MIeAO1ZdSEGXFybxJwCjvicAufmzUP9X1rvx4mvD7Jb4JCtuOfSsWg m9wtZ97xKTG8B5rW4LfNTxJ4qw8TWQqAffPA1+rpZGhkZSsIoaEbSaSL0ajIkiXaI592 8u3Q== 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 g3si1179072qkc.91.2019.03.14.07.44.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:36 -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-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) 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 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: , 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) 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(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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, void -virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) +virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, va_list list) { - va_list list; int flag; - va_start(list, qemuCaps); while ((flag = 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); } 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); +void virQEMUCapsSetVList(virQEMUCapsPtr qemuCaps, + va_list list) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1); void virQEMUCapsClear(virQEMUCapsPtr qemuCaps, From patchwork Thu Mar 14 14:43:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160336 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594808jad; Thu, 14 Mar 2019 07:44:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuxMcjfbfXrfGEzZk9R82i/W7UMjZOx9Nwep0BMo+1Y1/j03FqklC4V/esu8LoviJCnG8f X-Received: by 2002:a37:3013:: with SMTP id w19mr16801183qkw.220.1552574667295; Thu, 14 Mar 2019 07:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574667; cv=none; d=google.com; s=arc-20160816; b=SzHbBcNI5ZHZdjI4jLjI/ENXqAk38kEi+aP/ZJeD32EJYyWrnu04dKA17vW6BGu06N OdaXHQD/ZiSEKrS9q6VR28v8XNMFCCQS0GGNfLuBPUlFCgFQUdfz3iDNjAXUlq9mItUS fUim3LEM8VY8pkqG/PWRQIb0vNafMHIY5CtJP3kFPz3WBR0skvpdqT6cPh3nixiCWpwN s6kXWuEqmfs2966+VaKfqgsfVDR7bsVBu33z8R0d73ygFGFnSC1Ci2NG8miyU+lX4rtl WSeeKo4GzoOV5gcnZDlLAivRui81fyhwRtnStazQry6fdvFHPqquRBCt/4A8NUJ29mXc JfCg== 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=A6kuesMzgZiYGQafM674PPRE/1AdwyM1q6RdN89aOFg=; b=KBB2luji7h1QMo8FbwmnkzxfvWywMNaGFSGqlMlq17IK5ZGYZTLWAQMI0Ip6YBll0m 7gG8gZ9x/x2Sojo3KD/1nXaw6/9L3c7RFgX4/j5q32cdDEb/Js2VAgnzFPoXOCTiEY+P 1UIsepnILiA4dTuVrek2Os1iLVA5JnV4EW9CC//yEytskTBy5vC/pdcYyvgh9Rn1PDGU TBqvBFzeZCuE5t3qExzsad9V4V5U9GV/ekaKiVlfOXxuLg1PgUxm3CuF0mtGEguiKj0+ SEpGSnhuZ5KjS+DdWap535E52ITtbrfR/UYTgVHlkmRk0X7+7uEgBUpdE0Muduynrztm JKQg== 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 z22si7396968qtj.293.2019.03.14.07.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:27 -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-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) 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 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: , 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) For now it just fills in the qemuCaps list. We will expand it in future patches Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 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 67c5c74ec5..3b90cd1873 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -624,6 +624,18 @@ testCompareXMLToArgv(const void *data) return ret; } +static int +testInfoSetArgs(struct testInfo *info, ...) +{ + va_list argptr; + int ret = 0; + + va_start(argptr, info); + virQEMUCapsSetVList(info->qemuCaps, argptr); + va_end(argptr); + return ret; +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" 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 = -1; \ From patchwork Thu Mar 14 14:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160339 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594957jad; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi3uUrFkCoxL9IugPjjzN6R+zPAnz+Sbt2A848lFpypUcXozxvEIxHHuzdIZafcJLThRIw X-Received: by 2002:aed:22d6:: with SMTP id q22mr39280782qtc.171.1552574676357; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574676; cv=none; d=google.com; s=arc-20160816; b=QKwXHkWK/U2GjK/VKHnQB4PbVgf2g4FGy9VDoctwSuFcxWFmCffwQFTxKnPrcQ0Wso Pz5t7ywFFouFBYMvJUK1DwtWF3X+Hf2wTI+T2VrKS5Mkhg7L7uEFpZ+CXwPcfJ1GdHgR cmVUEN4/abYUwcU2E/BLsj0UK06X/8kSlFm1iXsrhp/7v3VsZsXA0j7HI/veQ6LXlHZs A+7rr8qKBFUPw2otMC5rrIpbfJYLb/EWRqB022YvoSSbQhPga3V96nmZcboupXD96CD1 xzy6bBKXml2yH8zDXe+2CbUNMbq5eKfZSBLRne9FQKwyJtoZu6ju2doKG3w/bcJbQdIQ 4imw== 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=DLBTGL/AMNBIE7WeYPuo4lZISk/byx2ludVobCj4mQk=; b=gbE1fwVwD7UoNKMmMJjmFptGKfn4u0frizGsv5bgZ+2KaKfReI1CxT6BQzK3/Mb1DB xw157GYDb331ejhZEy2A29LahRPYGnZa3z4nUMmp6AktuPDkOpI1DRDVbdujSGtfYPUY /b17I7tuCa8+fuDnJWAaNjfAbnUAvV4KgxAETWfGvNPM1S+RCszkbzYu5thokNIrX0at TEalI+nSXpL/3M0uLF3BDZRQxkXfYjByL2jKiEYcTxWX3RQeC3ama8P8pMbkFIFSs1j1 08b9odm0onfSVZQi/o6BHCAT1uEJ4dPS0SfGcZbSc/S9jvmb3GGnGd/I5AmMlTmcZbB2 WjkA== 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 z2si1642422qti.353.2019.03.14.07.44.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:36 -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-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) 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 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: , 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) 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 --- tests/qemuxml2argvtest.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 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 3b90cd1873..0dba908c70 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -624,14 +624,35 @@ testCompareXMLToArgv(const void *data) return ret; } +typedef enum { + ARG_QEMU_CAPS = 1, + + ARG_END = QEMU_CAPS_LAST, +} testInfoArgNames; + static int testInfoSetArgs(struct testInfo *info, ...) { va_list argptr; - int ret = 0; + testInfoArgNames argname; + int ret = -1; va_start(argptr, info); - virQEMUCapsSetVList(info->qemuCaps, argptr); + while ((argname = 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 = 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) \ From patchwork Thu Mar 14 14:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160343 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595040jad; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlh3A392RQZAPDAVf3u+m5lbSH57DpC19w7shfEGeyER2Iu9TdvHHZCXCc+oWWCdXuBmeo X-Received: by 2002:ac8:5354:: with SMTP id d20mr17863682qto.362.1552574680735; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574680; cv=none; d=google.com; s=arc-20160816; b=wVJTHi5wG+AQqnPeg3V28cn0B5CNfPs5uYmNooDAphPzqUXlVgEceVqSP5pEWvoIdo dYKIaPb10vhfi0aGi18gHDacA6PvIKpxkdOL85hEUhWSvQetCmmUS1nkugmGJ5vHWLae H/c4goGX12RHVySirFKp+U1VSZvGsd8r1Fb6+LVhUsw63NsVEQzByaH6JKuIrcP4MeK+ ZeDjYf2pXEsbIs/wqpKEFIRYCATSrJ68J8663+pk/MfobdYb/dWpzoaUcKdUetrtDigy UnCIPpnYDweWWh7NwSJ/1jt3hgPkCDnyq4sDFMFph/uvcC6iQEmUsDZ4aWSJzStBscq1 7sTg== 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=NrrQ3oSiW7oS8c5yn65u44dQq1yecIhXCiXne7cp7yw=; b=ZJTJWo2aeHPpjs2mSJasoox1O6Ot95DgEIv0DCr24tOYgJR3E8Z7/NMSvcpfnbuEtX Xmrg/P4LFkzaEDvyDdUuBKhzqlWknUeGJSILZk9v0vEqlvLsl32QIOQ4hYGF3zxkKPyE 358oqZacnODYE+8NCAnDhKBnAKmlSuegYlIDCqcCrKZ1795iQE+5AnHxZwz0OURbXSSc xm5qJPNDwTwmNm5uCZVDHCfUWP1P5bFcddj8Oj3k0yb+FqHq5mqkEY6HiZf5TSzCISQ1 RS6tZICQk9hBmSLih3ZzgZ/LWVrd71i/vw3zDrNcMhvs0+HMsK1dlbzsKE3cOMIDZA5U 3Fyg== 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 x26si926558qth.313.2019.03.14.07.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:40 -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-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) 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 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: , 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) This is necessary before we can start adding more optional parameter implementations to DO_TEST_FULL Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 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 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) # 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__) # 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__) # 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__) # 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__) # 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__) # define NONE QEMU_CAPS_LAST @@ -1707,12 +1711,17 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); - 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); DO_TEST_FULL("migrate-numa-unaligned", "stdio", 7, 0, 0, GIC_NONE, + ARG_QEMU_CAPS, QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM); @@ -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); @@ -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); From patchwork Thu Mar 14 14:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160337 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594869jad; Thu, 14 Mar 2019 07:44:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdW02NQennWQTjV7UiyyMdgnnLEy5LFwgn24n+ZVyZi6wmkKL+NGXCPa1xl80ThAtjM84U X-Received: by 2002:a0c:ad90:: with SMTP id w16mr39378469qvc.53.1552574670707; Thu, 14 Mar 2019 07:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574670; cv=none; d=google.com; s=arc-20160816; b=A5tVaPBMp5tE0D11hok3MbADbEHdGP/arAr1B0jm0Uuis/jDE08tMDzVRpXxlkjq66 eo7tYzbY/P6Tz+soH2z3xuxmVypgYOIAzqaUrAAeLgBDCqMjFfWe6A86DFDRif9G/wEq 80j06aNzn3SGrKzgQh4dxWOqzmQX0dp+dzawG+5Ky/zbbV2C0Zd7fRH1rRcNJFWOpY4N 65BVCQRH88JAiSQbgEgXSt3UQ6oFn0BZLvo7V44LdgJdRG6HbJHV+XK1ZROli156aOGX Bvh+ylk1083CizhC5Gl9DZegJdXv6Yf8fm2rLp+uWqdJgJnL46O/k6mjkv6Px7pDEfHc PGVA== 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=h4+cZbXzUCaIGp/iUJdXIGSUbgNFsmGXNS+kjt8hrjU=; b=wGc2naiQKGTpXOanQjbhvkKDvG5ScYQNnRZ7x3/nlPhlJesGNfODqsyC0j0mjgskP3 CkoQymOFpV887oxaSuzclzLENSjcYt/QfhW/yFvmtSElUtE1NY/+bFQNxtMxNk1rgwsq XDj0YfIuKB/lUGuCCWhAvq9gpQgvMAi4JQA20zkDACujDEPw+eXYYs/0klcHgcImc1Mf z+NSczX3oz0DPmqCNAziZY3sMf+9Z0ijBVo7S42VUhkxq6tR7vWZUClCzNERpM7qz+ri IT2bN8MMwyzVKFGpxzjY2PEnU7OUuYqp5M/OoeE0/qnqNlK3E7mMxu86q3XaiWEo2yVb cOuw== 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 z1si1447559qti.79.2019.03.14.07.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:30 -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-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) 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 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: , 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) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 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 393d2399fa..06a28178d0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -378,25 +378,6 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy) } -static int -testInitQEMUCaps(struct testInfo *info, - int gic) -{ - int ret = -1; - - if (!(info->qemuCaps = virQEMUCapsNew())) - goto cleanup; - - if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0) - goto cleanup; - - ret = 0; - - cleanup: - return ret; -} - - static int testUpdateQEMUCaps(const struct testInfo *info, virDomainObjPtr vm, @@ -840,7 +821,9 @@ mymain(void) static struct testInfo info = { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \ }; \ - if (testInitQEMUCaps(&info, gic) < 0) \ + if (!(info.qemuCaps = 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; \ From patchwork Thu Mar 14 14:43:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160342 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595036jad; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxW6DMDLpWRDGobvvtXleIskTvlcmn1ULonLiA9Q/ttMjdo1PsoNyaN4BtOjwIzC8d9MPU X-Received: by 2002:a37:790:: with SMTP id 138mr10597529qkh.271.1552574680462; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574680; cv=none; d=google.com; s=arc-20160816; b=ZzVa0Yh6kUDrBeH5S5gk4PUZoiuq4KJTIWgznrRvbcAqCU7nT5yqnzayLsKtTiMAkV t4DccDC+3E0RpR7CDG+UaqPH4OFk2qtcTu4uXK/d3f5HEBAzeemwwgwrhPBXFNgXZESP FwX+2lyT8/kob1aYI+1ooCXb+hkskyjHmJnD8sCYSzvX1epkLO1RmaPfS7oz4tmcgOmN ilxgs16MvU+r0ra4gjaoI8+8Bgcb6dqezJ3AdbODrdk/P8DmjPK+rgYyHYT9h7azuRjm S5K722ljffVspxeRHWXp6UMVkjajLXcgKgYbUXyEPICnfjvoSLhsLInN6rKR0H1lVPAV v8sw== 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=dFQvZvfrQMa3esP331aCmKN5RtkVocNg3X/8929KTWU=; b=zKMADs/FKTwqVcaooAlsBaG8D2NLyCRUGGPGks1wvTQ+G6pB7DvXrsmAjSv+4iMm6y SLvc5+sIhx+O78s6i+WUpyZDM2UgqhjyIU9hkzD1gdXBqdJUMZ/u/culPfMIRBY5dVzl VMXNuvF/qiNOcxemJ2ocx3JEPhuEF3MycPSEcjyhipSb/4B3qhgWTLXIa4TdXwyPlQHO /LyP3VzlZbXMyWqeV4KJoleOOzd4OczMc/wafGsRL/DHiooAnwPwXX2kYG7YeZIy4/9G WyV1saj7Lv3RNqgxjHeUQp8AkTsGKpqpV0A1HlVxHUpdIhZ5cYYyQBSbQ4GWVYmkTx30 lVNA== 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 h202si2689291qke.116.2019.03.14.07.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:40 -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-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) 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 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: , 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) This allows us to drop stub gic values from DO_TEST_FULL calls Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 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 06a28178d0..60df2c3a00 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -607,6 +607,7 @@ testCompareXMLToArgv(const void *data) typedef enum { ARG_QEMU_CAPS = 1, + ARG_GIC, ARG_END = QEMU_CAPS_LAST, } testInfoArgNames; @@ -625,6 +626,12 @@ testInfoSetArgs(struct testInfo *info, ...) virQEMUCapsSetVList(info->qemuCaps, argptr); break; + 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) # define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ - parseFlags, gic, ...) \ + parseFlags, ...) \ do { \ static struct testInfo info = { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \ }; \ if (!(info.qemuCaps = 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) # 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__) # 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__) # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ - 0, GIC_NONE, \ + 0, \ ARG_QEMU_CAPS, __VA_ARGS__) # 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__) # 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__) # define NONE QEMU_CAPS_LAST @@ -1694,16 +1700,16 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); - 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); - 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, From patchwork Thu Mar 14 14:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160340 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594958jad; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqylFW3BMDo/K8TOA4QsDZewXPOt4Qpxl9O+bO2dA4cKs0fgb+tEHoYXD6soPOZBRLVumrN2 X-Received: by 2002:a0c:afc8:: with SMTP id t8mr4943137qvc.123.1552574676422; Thu, 14 Mar 2019 07:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574676; cv=none; d=google.com; s=arc-20160816; b=jXBeuta2VDOlLRYCQBnI56ktkprZlCbwMNwzBBnsP7ATaT3qeVLlvPhpxSzjlKphlH lb103U9+D1OgIZn3+AtzjzPkgnWY6UmIzBS4ufchIMaveQ1I6dCiRGjTcgsuBjwMspCu BlkhSPkb0IXUrul4FKseYokhQE1b+mQzeVsaElr9hKtEX7UKijoCI3b6vnYFqsLEtYsA 49tPdZMd2ldBQnFso0FULOSaDBVNbU/qzJrjcr7hBXx0f08ZiwrY6qYv2cXoOR2r/cN5 7vsXgfAN5g4QK+PcKSxSH+0Fplc8JBhNvZd5u84NJSh04Pli/m65i2DedHjCxAE60Kd/ pTiw== 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=QQdYaHKxvsbT3jTPWBTPkBCnzb7r6mzTkDx/UONkpWQ=; b=myR0p3HJGYnVXgOB4oeS+tADQva7RrS2GTXV4JR/DXrK4lPlqIvtsq6sUkxFwA+PM2 YiuIeeTog3bQNkEkdTWcH3/dVx9slVBRBrk7Prx0GNZ7aYxQALX5skgL/2jiBmlKlM1n kerCALU4picPTCImnzd0DlTHvzAKQkq2vpiyK6w6uRZDPUzN7bTzrqrUzoQXvE+gdJ/Y Mm+zSlZiP+N9PzSoXEU+yUYeFEgbdfs1H0YQiC83XmpsLU9+UQ7+jzr0kF7oIT7cdoAa wSKn6socO6N0rla8aoWNsmzQXq3Yug5g7BFTSCSyLj3//AUWq42u74dp4yQrzBrT5TEv YK9g== 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 p4si828154qtn.189.2019.03.14.07.44.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:36 -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 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) 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 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: , 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) This allows us to drop migrateFrom and migrateFd from DO_TEST_FULL Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 46 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 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 60df2c3a00..c6bd240c54 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -608,6 +608,8 @@ testCompareXMLToArgv(const void *data) typedef enum { ARG_QEMU_CAPS = 1, ARG_GIC, + ARG_MIGRATE_FROM, + ARG_MIGRATE_FD, ARG_END = QEMU_CAPS_LAST, } testInfoArgNames; @@ -632,6 +634,14 @@ testInfoSetArgs(struct testInfo *info, ...) goto cleanup; break; + case ARG_MIGRATE_FROM: + info->migrateFrom = va_arg(argptr, char *); + break; + + case ARG_MIGRATE_FD: + info->migrateFd = 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) -# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ - parseFlags, ...) \ +# define DO_TEST_FULL(name, flags, parseFlags, ...) \ do { \ static struct testInfo info = { \ - name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \ + name, NULL, NULL, NULL, -1, (flags), parseFlags, \ }; \ if (!(info.qemuCaps = virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -839,27 +848,27 @@ mymain(void) } while (0) # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, NULL, -1, 0, 0, \ + DO_TEST_FULL(name, 0, 0, \ ARG_QEMU_CAPS, __VA_ARGS__) # 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__) # 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__) # 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__) # 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); - 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); - 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, From patchwork Thu Mar 14 14:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160345 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595121jad; Thu, 14 Mar 2019 07:44:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3oYLYfRJWcKlUxt3i7v15ynNiQTKFQpepU7bjXAoSmq88hH4JLhtMPGVwHcZsEYw4BNvL X-Received: by 2002:a37:6814:: with SMTP id d20mr15692643qkc.102.1552574685946; Thu, 14 Mar 2019 07:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574685; cv=none; d=google.com; s=arc-20160816; b=xGA0oH/Jyza4jvf6HaXeam4rHWlqjntLLTvbmfRVVC+yIJSqJNUdlhahj91FRjl40b V3yzlt+O8VvuVVQsnBBrDWiVP5kb47AjSCJZcItwAyBb5rzge5UCvRD0hIohr6f69y1f UmTa6zlh0lEB8oWwB6jz6vHl0pytLfq9FU6zmKeI4158e9zwLfylJqVt1Fc1zlgkTqsu xYE8II+ytH2QBm8V1nzE9/4PlCydWy5IopYta1+1F9pl+9SUdtOJvSGNfF2tKjrCsyQh WczmDWxka4r6n2vhPvtFLTEJ90KXzDPj0O1UB57qxzPocEAKnsYiEff9bP0guDSq0faC OPwQ== 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=Sn/XAXaan8qVFU4RLeY3QxnzyTO2eBJqWOMvOwG4FdU=; b=JUIzttVcB6y6ST3qssXLtKEBwfMkFfUPiyCm6csO3m+jLkz5dPUAvpI218OxQbKZ07 WO+2285o6csBx28gQWLfUgsvUm34b502i3uma3A74PnBG3dpHM0OOnZn4L/j+axixofK E9rFRE2O163dqn2D/Bd01J9Y4T2SiyRA7rJB2Av7/+2x+67Q0tVfoL/W7h6HL/mpE1v4 sZQ/O7yrqYbLidhnZN5KD7XU2/dFxirCNTLlRkqg0vW8ThBW8OQfXTycLOvFzKfNXDX6 HYrb73TeCbVTdYyvE5Hss017x3DLkYhiRXveCn+D4Xg1q40dvNaJYDYgDg7JgAqUEkpc qRNQ== 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 i6si1093797qkd.16.2019.03.14.07.44.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:45 -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-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) 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 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: , 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) This allows us to drop flags from DO_TEST_FULL Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 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 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, ARG_END = QEMU_CAPS_LAST, } testInfoArgNames; @@ -642,6 +643,10 @@ testInfoSetArgs(struct testInfo *info, ...) info->migrateFd = va_arg(argptr, int); break; + case ARG_FLAGS: + info->flags = 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) -# define DO_TEST_FULL(name, flags, parseFlags, ...) \ +# define DO_TEST_FULL(name, parseFlags, ...) \ do { \ static struct testInfo info = { \ - name, NULL, NULL, NULL, -1, (flags), parseFlags, \ + name, NULL, NULL, NULL, -1, 0, parseFlags, \ }; \ if (!(info.qemuCaps = virQEMUCapsNew())) \ return EXIT_FAILURE; \ @@ -848,29 +853,30 @@ mymain(void) } while (0) # define DO_TEST(name, ...) \ - DO_TEST_FULL(name, 0, 0, \ + DO_TEST_FULL(name, 0, \ ARG_QEMU_CAPS, __VA_ARGS__) # 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__) # 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__) # 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__) # 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__) # define NONE QEMU_CAPS_LAST @@ -1709,20 +1715,20 @@ mymain(void) QEMU_CAPS_CCW_CSSID_UNRESTRICTED, QEMU_CAPS_DEVICE_VFIO_CCW); - 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); - 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, 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, From patchwork Thu Mar 14 14:44:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160349 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595254jad; Thu, 14 Mar 2019 07:44:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd1jf2H/wKqfZkfcBjkz9f7Dj+O7rL1r5+p0NBA9DsOMo6g785fpgbED/hrCIndjTLsVc2 X-Received: by 2002:a0c:9e10:: with SMTP id p16mr38415226qve.176.1552574694779; Thu, 14 Mar 2019 07:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574694; cv=none; d=google.com; s=arc-20160816; b=bUMLp2Bo5mHTbrrHZuklPoAZ6c8CAZlm8MgwDJ6BathI+oPsO/opT53CRJ4ZqNRPCr pjbssgMT9d4TkUCHIFa36J2jJizHxumez6gFSDqxOTkV/U7qocLr5tX503D1uFOiTgq8 LcRsyjVwlVplN9eIkHV0p+plgY2JAkcLnEGKG5HVdhwc2xZrAcBbav/PeSztFltsZKBE ai0C8zsi6h+eSL35Ia1WNsLh7HIuJCVAwAhiOHnH1YSErgkYp1V70KldS6Bmdz5kuXaa JbMF7JKwWBFsxOdx+7bX8Upov2qgZMXxzgrhlEFWMXz6QmZCjuCudvU+Sy6ZNGxgTYVT 1vgQ== 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=JNiGFfx5v2M62V7d1t4xSEak+IthUaHXCUOUcw6Aqv8=; b=eJJadCr7+R0YNEgJKJTOmuU2fCKqRn4tn2hU3ts2r7KK/iVgkmPVjE5jqO1zpNgQTg nBd92NHmRfOHje9H02Laevi77CJFttUukwQwX0kRkyu0gaqiC6PxAFjffGmr7oMUsZcD 0X38pLRdD1Z/MwyV8kWK+r+dLf/x1HzWTF7+pPsAxmFSo0rFAkaYDLsQm1fL0WecHCYb UAa6FLbMO+Yi/e8EbVIaaE2du8YxN1D9bURIboca+NvlSVn9qMHM+WtKa3eif5EkATc+ luvGTgvWO14wwbq/+yowtJMOAh0NofvYt4tkw+lV+ugOlp+Sc7yfQSQy8V6s7nYlfTgz H6zg== 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 n34si128022qtn.318.2019.03.14.07.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:54 -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-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) 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 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: , 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) It only has one caller. Just use DO_TEST_FULL Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 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 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__) -# 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 /* Unset or set all envvars here that are copied in qemudBuildCommandLine @@ -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); DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, From patchwork Thu Mar 14 14:44:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160341 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595027jad; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTVl+AWA+k1ya7AeFuRBgIYJ59wowTHqEcrQxRzmkRl5JnQenpT7+uHVjds1QWDxOjxq9h X-Received: by 2002:ac8:271d:: with SMTP id g29mr39001376qtg.120.1552574680181; Thu, 14 Mar 2019 07:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574680; cv=none; d=google.com; s=arc-20160816; b=EuznlVeKHZ7JNeMjcFesFBPVc7GnySk4B4jbqC/d/Hn5gLuubzAqD+PZSMQz5fL+2c sTbUBZ4tBFr06+JlxVrLMgV2TJPzc7ZrDJmSlbPyaZZMXvJJ3drtuLITNZbIyTq7FlVk fqXDGMJoy/o4EoHHDx43VOdeOghh98Ry7NAJmnTN35qvOwdbNg4K4Q/SQ/AfCYFteECV wk6tSxmNTDcwc7qSNvQmyaSIA7JIrG7l2guWsK6LNqCd5PINSqgdVxgTMEJ9T0OkTdt0 bipcFVTv0VnalTQ9RjS1u6GU310Uo2KYokCeNQBdf5CT4P9dgWdDBorlNtTK1wqfeM7V HgWw== 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=+zOty5SPFv+gWopfktNx4ky5kAQVM0rd1Fkp2EzXtuo=; b=p2iCQ5J8ibsoOVAzfTLwIhTOm+CIZupW4xSfFENdksQ7xhbdMAAcXXAYaGyv55lLnT ZBXqe/D9DTUFl7ygtWRE7t+z2yKnPeGsJ1lM8y7idSDz2NrgCwuX16c2NpdyuJX5RUS3 i5AuvUmgHk401cspdUVnNvDa8ZLo5OdHRyokM2FSCwBj021Nwbme2O7lbLMm+8d5XYOs OZ7xO3HFHlYnV8CmdMaIeUxOT1DbYaGQdB1wzqTCqRAcFGSTBDSw6OLn+8zAHwnU9AYJ n0UrZB93nWc5R7s85/eddSpXaq5v9aKQ/miV1LQkiv+J8yi3MTMgXT4gpohC3rT9Ts1p zGPg== 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 u3si143032qkj.57.2019.03.14.07.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:40 -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-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) 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 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: , 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) They are potentially useful at the moment, but we will be making things much more flexible Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 10 ---------- 1 file changed, 10 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 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) -/** - * The following test macros should be used only in cases when the tests require - * 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", ver) - -# define DO_TEST_CAPS(name, ver) \ - DO_TEST_CAPS_FULL(name, 0, 0, ver) - # define DO_TEST_FULL(name, ...) \ do { \ static struct testInfo info = { \ From patchwork Thu Mar 14 14:44:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160351 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595313jad; Thu, 14 Mar 2019 07:44:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyOaUnuB3Uu+mEX5F7FXFvmg/JYQrdH6pEQiTNoB3rxS6sVNv3MbQFEYStptYSmnCiFHrx X-Received: by 2002:ac8:1497:: with SMTP id l23mr38721941qtj.296.1552574697801; Thu, 14 Mar 2019 07:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574697; cv=none; d=google.com; s=arc-20160816; b=o/U85+Ui6Lyi+31NF9IID2vafr7plIkRsTqFNy+iOKl+/a/WD7gwp+jfFjs9QU27YH 7SAisTvTYSgrsyZOR6cvDKibwACPkazRPbPGFd13yjST71vRK0TK3PqakrgyXrK8wdJd /51t8vQqyzoZunAfYKOBAb6AWbpXrXwbcrxlVhBNW7tlGwz5HXBD4qizqi8v3MF967ue VVS536nDuX+VrjPfHTta3xwJzQcX6BN8TsIX3gp1R3i3jQnaM/nTTqM/zEk6wYv0Ib4e tVRGOdgNKti3CmIB+B7DRe3Rc5KwCjRa+vYzvFQzlRU25nK0qeu4MOc+X5MlDLsCWef5 Z98Q== 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=UduWDYswk4bq+/gLp1m3/RNn8BBiAmhmSN4DMrfkF2Y=; b=DiABnutHG/e1gN0pQPr2KN5RI1BWCJ8x9dXlJ669jXmljtyM6AidVBXwEctONSQmZv FZcObdBnb3wiR9s3giCwBCET27seDNevLTysQA46HzhOjA2z71Jlc2TNTikVzM7+/2x+ N5v2DlY77inkCEvWq7eFmDY1WoMvvAYGKzhv7zKIDShDUC6CszClq8oiDZP02iHRX5Ip zYTiM4Xybca5/nrI3HIpVz/RVrCzn1yqV6FyVFUrB9OZhgrx3Ugd1nm0a3wW6NaGbc5G KeFYlKm6H0ge3iTPtnuXz7EXBlqTxBiiTQCOg3hmA6yIr5QUuqFvKbrthtnI2sw0bkZf 8a2w== 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 o15si2785514qtg.278.2019.03.14.07.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:57 -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-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) 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 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: , 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) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 3 +++ 1 file changed, 3 insertions(+) -- 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 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) + +/* 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 = { \ From patchwork Thu Mar 14 14:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160344 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595083jad; Thu, 14 Mar 2019 07:44:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqykgmeAKPGwoiAWkVu+HLi8/aeGU6k70VZBd6S9WApCZ0e4PLTm+keu7mwrOw0oG2Fr7B3s X-Received: by 2002:ac8:26b2:: with SMTP id 47mr23524803qto.224.1552574684005; Thu, 14 Mar 2019 07:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574684; cv=none; d=google.com; s=arc-20160816; b=cx4K8+fJMqQPqeweFe61u43JCDPdDT6O8ToYfkh7PCw2EmUjOysJvHTBSnKsPKccPI NAGxVwnqfrgsLjlKMJCCciDSr10ggC+DvplJBS6/rzoWpvTH5QA00BE/ZLTRCADS935/ rbJ4HxD8+s62cUlZ5hRKco0Y/vmrmxP3stvVPiSZllz/NkQFsFAGmdbJ5vvb2RukwLqz yiDVm3Ur05yq5OXeOJmysKWtjchF7XQfxpilQxKtHHKK0lYngMVqadjy9ZyAKHPTyHZ4 QLHeqNZS1T1iA7e87Co0kbnHXS9Tx8UEPcBjWhDl4ZFZ8sjwIJsQQnTQnnKg0ezdVJWr omsg== 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=1agBuIpOqqiwb7ehY7kwY0lx249eKzziHaDGCiugaM4=; b=fcxJDj43e9+h4GnFga3Ez8ErqXJwMvZb5/5nEre0r67Z1qZCgfLdhKkUvVy5C4aTnZ CFMRHLX0hYi0cOAeFAlYydPCYnN4sJYkY03TRaV0wML4nN2hgqvVkCEIb1WQRXoKsDQq OCzp6ce8jMNTGPvcImK8ulnqRAV4caqHZhwqtdoQSQXxIKrwemkWXu4ndfo7Ja4bMDWK 3Mt8t18n7sZij4LFilTiSYwS/A1wb9GckPLhTQMH+oIzJqZEe+Rd8GDwu9kElhUjAfZX yNvdOocByRKjSIutkB7sjos61AM6ltonmdCum5U4m74QfGuSbXesvF3tzQVc1y5dXpxy zI7g== 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 y53si2301082qth.156.2019.03.14.07.44.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:43 -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 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) 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 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: , 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) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 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 appropriate * version. */ -# define DO_TEST_CAPS_INTERNAL(name, suffix, migrateFrom, flags, parseFlags, \ +# define DO_TEST_CAPS_INTERNAL(name, suffix, flags, parseFlags, \ arch, capsfile, stripmachinealiases) \ do { \ static struct testInfo info = { \ - name, "." suffix, NULL, migrateFrom, migrateFrom ? 7 : -1,\ + name, "." suffix, NULL, NULL, -1,\ (flags | FLAG_REAL_CAPS), parseFlags, \ }; \ if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ @@ -807,7 +807,7 @@ mymain(void) # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" # 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) # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ @@ -817,7 +817,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, flags, parseFlags) \ - DO_TEST_CAPS_INTERNAL(name, arch "-latest", NULL, flags, parseFlags, arch, \ + DO_TEST_CAPS_INTERNAL(name, arch "-latest", flags, parseFlags, arch, \ virHashLookup(capslatest, arch), true) # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ From patchwork Thu Mar 14 14:44:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160352 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595392jad; Thu, 14 Mar 2019 07:45:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyKiv4iqbmmW6nRhvrS2LUdhcKHrayGHby14E7KiigPT/hvicxiRAAHxu39kTZb9oPdZ/A X-Received: by 2002:ad4:5145:: with SMTP id g5mr18286564qvq.217.1552574701771; Thu, 14 Mar 2019 07:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574701; cv=none; d=google.com; s=arc-20160816; b=s+hEFlpU4mBfQmvSPKrhT3waCOdVBCaaBHwisIqWawAHWfxw2NZDVoi02xhvEpdFlQ T6SI5x+3MiULYsGonsoEEXnm2oPIhtgtSgjv8UDVtohBhqaUfGRBzcCNIfUoSIB5iyLp AtEKqDomPEDbvf26eeOJaiNVSXBKWyLmFyWnB633sc+Ube2uzGb6pQYcRDh1AMwz3p9x uR5u/9VLF/Hlk32yANvSHa3AsColFOhW0Gm5vTHJEnQWZdtLRjhc6MlMOMcGjIsYSS2v 8sVGaonluqD82pweY6qcojmaG80ifcR9tcgeAxRSQbAMM5K1qrLa2Mug2kyyl5oe7Pb7 YWJg== 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=hes6w0GAXc4LyH/HI/bRuxaDnT0/XyQgcUsUobuW7NA=; b=IKapHO/7M/D1wbk7A2KMfukB5o8zaT4PWZxC5W32scoTRqW/dDypwFWttTehZZCYMo DvJ94PrkViImjb/SVkrEShcAfSkhqRaJYmDwTvDy0lpXpBpKPxvs1E4BNTeex1q3M2nQ cYAj2mgvwHVyR9+JfLfBntOYWi5ATloynkSgBDKFV85abxmitV5cX8cmsH6bvV4/r88r T/pUJPXMsFsj6lffyxFfafpjI76IP6YGqXg1Q2ILFn8lJQkdDvwdXw9rVpWYuqbheuKE 9d312vz6sEsmDr2QiRolbarvVuZ7ETiu7uYfqTHvYYVeSSmkXr9jhBtV9swRL6EgXTmz zu1Q== 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 u33si6749qvg.119.2019.03.14.07.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 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) 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 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: , 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) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 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 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 appropriate * 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 = { \ - name, "." suffix, NULL, NULL, -1,\ - (flags | FLAG_REAL_CAPS), parseFlags, \ + name, "." suffix, NULL, NULL, -1, 0, 0, \ }; \ if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ capsfile))) \ return EXIT_FAILURE; \ if (stripmachinealiases) \ virQEMUCapsStripMachineAliases(info.qemuCaps); \ + if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ + return EXIT_FAILURE; \ + info.flags |= FLAG_REAL_CAPS; \ if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ @@ -806,31 +808,35 @@ mymain(void) # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" -# 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__) # 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) # define DO_TEST_CAPS_VER(name, ver) \ DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) -# 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__) # 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) # define DO_TEST_CAPS_LATEST(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "x86_64") # 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) # 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) /* All the following macros require an explicit QEMU_CAPS_* list From patchwork Thu Mar 14 14:44:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160346 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595160jad; Thu, 14 Mar 2019 07:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEgQf5oTCv/jenY5eBnQTwQyeZ3jP0r2hsUQSHv+qwdZXczVmfJ9SIWMABdV4y36hxJA42 X-Received: by 2002:a0c:d60d:: with SMTP id c13mr40124466qvj.43.1552574688427; Thu, 14 Mar 2019 07:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574688; cv=none; d=google.com; s=arc-20160816; b=KZF41V80Tk4zQrMTCJexdj44Yqa45jXAguR5DVEP0KoOdTjhSxP6jeI8oLNiEi0sG9 gdOeQqU+N1e12C7rW1hes8hptBxAGfOOY5V5zGZPBlQp2QXkDWgjEJl1R4phwB5yzt5h HWEMtkrwVHGZwaHNwUdQ2Uznb9DJec7YoZbDNB2eHMcMy51xHg1RV8nV169oFuz1yMxe Mh4dc18lbw0uBZE0DNupFr4k1qIsmHhrn5XirR+veQmlfKCq0bwTJELrB4a8SE5iQaMb qBrGSIpW0C+CcdZioUfq8U9RI2Op5j1lpTjgNbFUpLDfulPCCO3syoycrIPoKLt35rQk Oagg== 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=39PtS6RDNm6IbzqeeBJHswR2t1NuvDgDpJFiCgSIFwM=; b=b6Jr1l2p10pKuvTauhgvu1TgSAxjX/3erspcTbGOlnltOdsNhCy0e1qA7uwji6O3kA H9wNfWwevJb2+dacFekUBnYc7isqFxsLUiYeRBsh2fPlVroZFmdN6yAZ1uCwDDlTCI39 fXKnLpChD8fs+3o3lSi0Q5T9/Cpv5N3orq7adsJHUAeX6KWovjXklqq40kulJ1OAR6Z+ GPBw1/u9sdqkj6fMfPV4whVAVVzOJpSzyO8z4p5ug5KBL0PecKYYOPhjT9HmoSNzoTCP e5YSktnw4QwSeg+K6sBCmY9N2jcIXyWwCgwp8ETOhOm6gMr37xZ9RIzXz9d5mbhctC7/ ZcDg== 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 z43si1194943qve.155.2019.03.14.07.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 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) 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 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: , 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) Only initialize the fields that are passed in Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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 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 appropriate * version. */ -# define DO_TEST_CAPS_INTERNAL(name, suffix, \ +# define DO_TEST_CAPS_INTERNAL(_name, _suffix, \ arch, capsfile, stripmachinealiases, ...) \ do { \ static struct testInfo info = { \ - name, "." suffix, NULL, NULL, -1, 0, 0, \ + .name = _name, \ + .suffix = "." _suffix, \ }; \ if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ capsfile))) \ @@ -800,7 +801,7 @@ mymain(void) if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ info.flags |= FLAG_REAL_CAPS; \ - if (virTestRun("QEMU XML-2-ARGV " name "." suffix, \ + if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ virObjectUnref(info.qemuCaps); \ @@ -841,16 +842,16 @@ mymain(void) /* 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 = { \ - name, NULL, NULL, NULL, -1, 0, 0, \ + .name = _name, \ }; \ if (!(info.qemuCaps = 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 = -1; \ virObjectUnref(info.qemuCaps); \ From patchwork Thu Mar 14 14:44:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160348 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595195jad; Thu, 14 Mar 2019 07:44:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8xo7QqFbgws40CUD8Xx00q4kt7JMy+qSMH6SBxIoalOd1VuqRJD9yxouCBtKxGSXX4aXX X-Received: by 2002:a37:5f85:: with SMTP id t127mr37785756qkb.268.1552574690669; Thu, 14 Mar 2019 07:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574690; cv=none; d=google.com; s=arc-20160816; b=gLhJsgQu93ECakhgJ8jK1e4SNBfbC0K/v5MJy8s0FiuXQpWmj//ld1FYuQgixrrWKA mX4S5SM1ghnrsyDJjsZ2HSFMI2Kh9CcfnXZpCN4gUfIykUjIC3nJ70EjIOVQrr2/nvKk 1rwU5wfmV1PbJLr6Af+W3YIcEkelanw3yeDQURyinFfDdPScrB/33dAfi710gl6IF4cl M/yOs+oXX/jEXlpLVR0Lp66s8W+zYXdmfCnqQYadLi0qXgqwJ5UKzgQF1i7L+FK1Uccx +VQaq8pJTdnwUGtGnv6/7d0lY4XprtZPRo0PyyusBqs5by/Qg/wkvzCdA+OHzDex2c93 HBmw== 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=gco2A55kbF9wAwlYgjxkY/B5YIGzupNeVHr8a3eo2r0=; b=fb971jd/lDwzhI/6jebBkYn79/XPWjQ6x84O5mkLOyAxIrNCUDTO00E2v6WJMJjN33 EbmuirjyDgPA5XSvZu0mQ63tr7dd06sYDfS22R4PV9lYGIAnOYUBi4dRGlYxltcTSZjl XMTQ03LbEcZ9nM/KYgfBqD8gY3JTle7P0nQ4g5Ay7to3sTsgYKGdz+8NHNQ6A4f6LO4Z +iL6B1nm916KWB4zFVGjVs9GdyBgAUJtjKSu7gZ87ctNOOhOGZeqxZJyMY7D0ANBDNc6 rCKu0FplIwzjg+JeRJvF+A3EeGerBlggTi2Md7EIV2ap+d8RWk7aAWiTIETsEi9Vj8Jx EC4A== 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 n11si1714750qvq.32.2019.03.14.07.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:50 -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-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) 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 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: , 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) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 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 appropriate * 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 = { \ .name = _name, \ - .suffix = "." _suffix, \ + .suffix = "." arch "-" ver, \ }; \ if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ capsfile))) \ @@ -801,7 +801,7 @@ mymain(void) if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ info.flags |= FLAG_REAL_CAPS; \ - if (virTestRun("QEMU XML-2-ARGV " _name "." _suffix, \ + if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ virObjectUnref(info.qemuCaps); \ @@ -810,8 +810,8 @@ mymain(void) # 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, \ - arch, TEST_CAPS_PATH ver "." arch ".xml", false, \ + DO_TEST_CAPS_INTERNAL(name, arch, ver, \ + TEST_CAPS_PATH ver "." arch ".xml", false, \ __VA_ARGS__) # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ @@ -821,7 +821,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) # 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__) From patchwork Thu Mar 14 14:44:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160350 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595251jad; Thu, 14 Mar 2019 07:44:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqypLAXyvDxFYEWN4x5Ly9LZZBFQqh6cZU3pHhcSOOoXjiZiLWLL3cFhcEyBRKIgtrO8sXLa X-Received: by 2002:a05:620a:1245:: with SMTP id a5mr16565574qkl.340.1552574694502; Thu, 14 Mar 2019 07:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574694; cv=none; d=google.com; s=arc-20160816; b=aRb9hNO8rYHevqZSh2PmpWkrEpc3r3EFLQrz/XyVQNXZRwqALE0Bh6hiQ4Gi3/doUD gcOFflUd9n+75v4rzbvJrtFl8Wy2+1Ud6H1kP7P9jXfAQRj17eTA9fev3wFF2kUNfbOE 6ZxhmvVYFVOzT+9OK1Uc/aGJQ2LUWbhO7hJq0nBVtL485UQHh2swalSBCQN9bb2Xyw6m /d0gST9whwQM82tUKHBG/6GIYbmfe8Sw5/Wwi7apLoAJm6tDvMQYvwVZjWTZT3dTx13X OOWWoIuMoUzTo1PXuo5tIyPeKQ3STSAiramWbG3GmZ+ujF33b7ULwTGgBaGN6VgzZu7m atWQ== 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=CerImO44L9AIhKloj6UISPTZOckhDpHO0p8v02W28Q0=; b=T66r6ouwrPNvRFsN14KwOvwCEy4eEvQR3ImVwyGPyJK8FOrTHLcbvSgQRLwuk231bA 1U1xfHuoeGbfiMdaRXHLTzoOJgZyIfeNCytnwzWw6h3joHUjEv+MkymH2KcjeJD7MWE+ tyELCn8in/qKAXz9LUq7YK+FtvqG9sXC6UqXkHNw0bzrp3DFGCj3KwC+L77Wt5gVL28w 2R1Upwq1Gtx4LHnKxR0Kpb+cUHZTZHz7tXnuTfTX3VDbmYzx9seDPIaZWeBF72Iglaza RQuLFUr8PGdYHfNntyRSBEYkgrdcMbXE6GLooK++VGZbX+STmkCfsTa3CI4+gN4ztoGM S9YA== 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 p123si1042749qkc.60.2019.03.14.07.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:54 -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-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) 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 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: , 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) 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 --- tests/qemuxml2argvtest.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 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 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 appropriate * 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 = { \ .name = _name, \ .suffix = "." arch "-" ver, \ }; \ + static const char *capsfile = TEST_CAPS_PATH ver "." arch ".xml"; \ + static bool stripmachinealiases; \ + if (STREQ(ver, "latest")) { \ + capsfile = virHashLookup(capslatest, arch); \ + stripmachinealiases = true; \ + } \ if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ capsfile))) \ return EXIT_FAILURE; \ @@ -807,23 +814,15 @@ mymain(void) virObjectUnref(info.qemuCaps); \ } while (0) -# 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__) # 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) # define DO_TEST_CAPS_VER(name, ver) \ DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver) # 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__) # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END) From patchwork Thu Mar 14 14:44:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160353 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595491jad; Thu, 14 Mar 2019 07:45:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOQZhEpaKf6ru7EZeD1Y18yKLbR2DyU/bmAgC6NorxvEXwwxd7DMmqJB6l5rJZyveZUyET X-Received: by 2002:ac8:33cf:: with SMTP id d15mr9331320qtb.149.1552574706831; Thu, 14 Mar 2019 07:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574706; cv=none; d=google.com; s=arc-20160816; b=lsmUENvcO8ncbToXBXxmx01oAuc1ETusIyU08n++56Pf7jaFvn3bw+zCHIJyVRR4aP cvLjRGsUNOf492mhxCfatlXlMFyQqvAc6gMuhqtQXLFPE4h5e2i524zRb0Vlok7m3yfT ZYi/CFCTGoDgCvxv7OZVfwn9RV7XyHPHebldekn+hWxTjQPkxtJ05eoFd/B6ppHPLGlP v6OLK9Q+EiIl7eIMwFhWtQ00BJsRJnVhTfJVPbyWioWS5ybhKf3Tl5m4WkyAt+eDlMC6 k5NUiK9SL7RxVwuRxANd8knuqEYXkmyyOlqHurwe9y9jQByvOJ3ZApr0XuRU5h4PnvA5 YqSA== 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=8hwdut9TZaviSC3lhpSar1+2IeTzSSe/z0d9edOmSP0=; b=Dc3TrNSnh5YtDtAl9YAylGzoINqouUskL6TtMKOAM8N3iCPoPO+zQKec8NgNh1l1uN cQ9uaw4YmGYYQfUmSWtAVjKtLj1r7ZlG7kDXW30VOyzd/TApmlCIpNfpb8qRAOv40Uip XLVBN75R9Px1z+K0hSRqalaYaXHfEH6Y85bFSCZMDjsKJsRs3JHKnWsu5lrbBW4UO+qL 3oobPge+PVndsa1MjyEgW8Op3J3DrEWhIvViM8sFMJ6A3fr0L47u0gccTTNwAx7rt5Zh PVpbt/jLtrhjNDpQiYf23xJMtlwiRSMjf85sEOZMN53mQ+KERB5fUeKWca13VU5rt7yf UFlw== 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 d12si4726333qtd.228.2019.03.14.07.45.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:06 -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-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) 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 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: , 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) 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 --- tests/qemuxml2argvtest.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 496e33f4e5..813871d6b8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -665,6 +665,12 @@ testInfoSetArgs(struct testInfo *info, ...) return ret; } +static void +testInfoClear(struct testInfo *info) +{ + virObjectUnref(info->qemuCaps); +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" static int @@ -811,10 +817,9 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) - # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) @@ -853,7 +858,7 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) # define DO_TEST(name, ...) \ From patchwork Thu Mar 14 14:44:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160354 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595592jad; Thu, 14 Mar 2019 07:45:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOLEpifWF90Doa3ojgKvNaTFP2vMbZ59HRRG3/t1J94H9DuPXqv+A0dUgiMOISaHRb6FOS X-Received: by 2002:a0c:b89e:: with SMTP id y30mr39470805qvf.52.1552574713054; Thu, 14 Mar 2019 07:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574713; cv=none; d=google.com; s=arc-20160816; b=Sc5YjQob8pii/9tD7fkAs+7g+Qajb4m5aGgXRVGQYhDZjVrUzDIjWlb/jv60aYpLz6 NiFw4qrhb++lPmbEXy9dwNYn+F8FSWnU8XSNBvpw5y/3eI5UeILShEiL4e55hsX1GS9Z 7leCdUp+/eoMxSc5tVpgyD0mReFdraRXbyrCtlOzqveDVaV2FSTTJM/jgHdiQy6i7aak K5Z5V6Z1+SeLrPUKYkFi4Qa1Ncaa/+VbJyeMuc9cfgmssQXpOg69t00MKBE9TEhzM88W PuxqWqUviMLidhuPGmCpr5TLTary2Uvz1KYjPGX9BTVjN3DacfeFtKsm1qCq/XHYVYnq HgJA== 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=B8mgTd6LjVhQD+XPcMP1ivLHg9SzJxWb6QIkiiY8Nvk=; b=QFt2guNfObyxL5VJD5K3Pzq0StxPSySORWW/DFEn2wosnKWzvUEzyu/bXySkjaB4LX 87FP8hprZSbXgwIPBNOvYazOov8HFp9NrRrYa0huWYFSvPdX3hvkwsBbe9COW9+fVqMC 13GI36a2CgdThsq03YRyuFtx/Pw8zK+ANP+1a4sYWgDQFmEIj38JNjS8SLhVkfxM5TSB sMCjxTd0XXGVjLMlXK44djyskdhW45P9/X1ZZP2lqeeESImIfBH+nH8AfXXsGcO6n4Dq cu1lSUYArt78hFj1bvslVJfGORPGSp1DlouLwi0ptmj3BP+EMz0U9dVhseeFGPqIY0iK xobQ== 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 z42si4519144qve.19.2019.03.14.07.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:13 -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 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) 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 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: , 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) Move DO_TEST* qemuCaps init into testInfoSetArgs. This is a step towards unifying the different test macro implementations Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 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 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 = NULL; + int gic = GIC_NONE; int ret = -1; va_start(argptr, info); while ((argname = va_arg(argptr, int)) < ARG_END) { switch (argname) { case ARG_QEMU_CAPS: - virQEMUCapsSetVList(info->qemuCaps, argptr); + if (qemuCaps || !(qemuCaps = virQEMUCapsNew())) + goto cleanup; + virQEMUCapsSetVList(qemuCaps, argptr); break; case ARG_GIC: - if (testQemuCapsSetGIC(info->qemuCaps, - va_arg(argptr, int)) < 0) - goto cleanup; + gic = va_arg(argptr, int); break; case ARG_MIGRATE_FROM: @@ -659,8 +661,20 @@ testInfoSetArgs(struct testInfo *info, ...) } } + 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 = 0; cleanup: + virObjectUnref(qemuCaps); va_end(argptr); return ret; } @@ -851,8 +865,6 @@ mymain(void) static struct testInfo info = { \ .name = _name, \ }; \ - if (!(info.qemuCaps = 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, \ From patchwork Thu Mar 14 14:44:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160355 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595913jad; Thu, 14 Mar 2019 07:45:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOybw2ZQPpUNX22SefTZd6ZbwJSHpgAP+rbzXwah6TTLj7Xo/w6Q0ZzaNC2gifl9PmfOMn X-Received: by 2002:a0c:f910:: with SMTP id v16mr21341323qvn.208.1552574733166; Thu, 14 Mar 2019 07:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574733; cv=none; d=google.com; s=arc-20160816; b=YnqBPlkcJqF8csoBHIN72mh7ZU6cCJ5SYeiOpIirPrj4oX4zZm3V192x2eHw8rn2/c C4YDul3bBl+QVt+yRWSOcPgrHSo9TsfmNnyVdmkGKivZ8NlB8XLyTPWKczmCPvMRxpak AhH5UwGwA+XweLDBHL4KtRLHF7xUFxnbd/tvHXpJDghEnufqmBBu5C0V961H8eTNgnfN 8QlQcZkcvfLcYmU17DVqubQEGEifBhLlaiLDT5ASQ0TmTscHXfDxtLJ+LvaBmo1eiXD2 4WtWUhr6bigraOOnFP40svLzkQOnKQMkgksix5APuPS83lRyhS6x3Bcgf1oh3hyK+62H M3mA== 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=RvRjvI5UP6UbxyGPR5wULdnYMCm27C/Beu43Rz4+PYk=; b=wcSlbFmkOxUXYF6TTLYuOTfDA5M3B8RRrwBgJoIbMllNIcwDZ6V8DSaiNMhRii0lyj boN9nEjp59WHpJ3MzFrr3Sa3W2rAsp4SC3T79u1xlrHgoz+/rX5+fMpz0R/GwhBJh+hg jgWuJJxRgjRgilNP9a5hP739dbaw6oLyMdF99SZFux0qyDciz+bXjx/AXyPU1foXB0Jn Rz1/p27ViX4xmSQ0NFo5dh5bSD/3mdxSja0X8vxfTmqiHi/RYA/qL67tZ77aIFP5AQuk G8KTCG1u1KGuGBVKdyyAOhBLPOZaAjQhacyeCmy+P95lto4v4C3r24LnAUXD52NlA+cd ffBw== 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 f124si1544782qkc.236.2019.03.14.07.45.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:33 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 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) 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 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: , 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) 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(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ff74892944..d5e02c26d8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -605,6 +605,8 @@ testCompareXMLToArgv(const void *data) return ret; } +# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" + typedef enum { ARG_QEMU_CAPS = 1, ARG_GIC, @@ -612,20 +614,25 @@ typedef enum { ARG_MIGRATE_FD, ARG_FLAGS, ARG_PARSEFLAGS, + ARG_CAPS_ARCH, + ARG_CAPS_VER, ARG_END = QEMU_CAPS_LAST, } testInfoArgNames; static int -testInfoSetArgs(struct testInfo *info, ...) +testInfoSetArgs(struct testInfo *info, virHashTablePtr capslatest, ...) { va_list argptr; testInfoArgNames argname; virQEMUCapsPtr qemuCaps = NULL; int gic = GIC_NONE; int ret = -1; + char *capsarch = NULL; + char *capsver = NULL; + VIR_AUTOFREE(char *) capsfile = NULL; - va_start(argptr, info); + va_start(argptr, capslatest); while ((argname = va_arg(argptr, int)) < ARG_END) { switch (argname) { case ARG_QEMU_CAPS: @@ -654,6 +661,14 @@ testInfoSetArgs(struct testInfo *info, ...) info->parseFlags = va_arg(argptr, int); break; + case ARG_CAPS_ARCH: + capsarch = va_arg(argptr, char *); + break; + + case ARG_CAPS_VER: + capsver = va_arg(argptr, char *); + break; + case ARG_END: default: fprintf(stderr, "Unexpected test info argument"); @@ -661,13 +676,33 @@ testInfoSetArgs(struct testInfo *info, ...) } } - if (!info->qemuCaps) { - if (!qemuCaps) { - fprintf(stderr, "No qemuCaps generated\n"); + if (!qemuCaps && capsarch && capsver) { + bool stripmachinealiases = false; + + if (STREQ(capsver, "latest")) { + if (VIR_STRDUP(capsfile, virHashLookup(capslatest, capsarch)) < 0) + goto cleanup; + stripmachinealiases = true; + } else if (virAsprintf(&capsfile, + TEST_CAPS_PATH "%s.%s.xml", + capsver, capsarch) < 0) { goto cleanup; } - VIR_STEAL_PTR(info->qemuCaps, qemuCaps); + + if (!(qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(capsarch), + capsfile))) + goto cleanup; + + if (stripmachinealiases) + virQEMUCapsStripMachineAliases(qemuCaps); + info->flags |= FLAG_REAL_CAPS; + } + + if (!qemuCaps) { + fprintf(stderr, "No qemuCaps generated\n"); + goto cleanup; } + VIR_STEAL_PTR(info->qemuCaps, qemuCaps); if (gic && 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 appropriate * version. */ -# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" # define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ do { \ @@ -814,20 +848,11 @@ mymain(void) .name = _name, \ .suffix = "." arch "-" ver, \ }; \ - static const char *capsfile = TEST_CAPS_PATH ver "." arch ".xml"; \ - static bool stripmachinealiases; \ - if (STREQ(ver, "latest")) { \ - capsfile = virHashLookup(capslatest, arch); \ - stripmachinealiases = true; \ - } \ - if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \ - capsfile))) \ - return EXIT_FAILURE; \ - if (stripmachinealiases) \ - virQEMUCapsStripMachineAliases(info.qemuCaps); \ - if (testInfoSetArgs(&info, __VA_ARGS__, ARG_END) < 0) \ + if (testInfoSetArgs(&info, capslatest, \ + ARG_CAPS_ARCH, arch, \ + ARG_CAPS_VER, ver, \ + __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ - info.flags |= FLAG_REAL_CAPS; \ if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ @@ -865,7 +890,8 @@ mymain(void) static struct testInfo info = { \ .name = _name, \ }; \ - if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ + if (testInfoSetArgs(&info, capslatest, \ + __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ return EXIT_FAILURE; \ if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ From patchwork Thu Mar 14 14:44:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160356 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15596066jad; Thu, 14 Mar 2019 07:45:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtBho2q3AHXLeJn1gVSQNDsCgKu2yag+6Jdmhyj8fClKvwKqkcFlmP2+ilP1lBrS7OjT0g X-Received: by 2002:aed:3579:: with SMTP id b54mr26486368qte.248.1552574741150; Thu, 14 Mar 2019 07:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574741; cv=none; d=google.com; s=arc-20160816; b=VnqdRQmbiKmJZMd3G1mqV05ZE8oeIGsodQfUHETm+m2NQ1fJaYCWlSCAfw1KuUVfJT AEHjJB6AryM6py1Rk+T4q1uMDAOoPfQtBQtlD+z2+3olAEvNlpJ4VMRxWLilFX7DyChb +Pbgw50rrRyVyGvXrEU7/3r93EIFs0XJMh6+KLMh24F1AyDGf+7tj73GBf2SiNdar/zI s+hKu8q2BMXF3BjXDSsZCq0Hf5K3F1Fyvcs28SYYqaRg+YxL7dWoKQV6xGi1EaCpF/Rz CcZ9tJBnKEGfISIIj49tRlebgcBP6QXeAX75cJnwNdAPO7Ad28by2OhQSYSlx08SY+sb CQKw== 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=xScnbVNNEdINewpnwb4yKtSeiNuXt191a4dGuEQxGo4=; b=h5czCM/7KXKXCKxaQzr4YYD4kBVscNNsa/NjsUUV9lWMmsAKITeeEPm4yNBNle6QwL nEi/JIPg1ONdy28TVbJQN9uqBX+ACx6BtpDYlltDwXg6ZYBk7ZcvfvvSVFZDSIknCGbJ +l+P+6j11rNpIEKfuZCMFKNoMUqfstxgyVQVo0nstpDOsv+jHVLREr1X1uSzXoTZg9Sm 2c68tJpRC+MA/FqzmXrV6BEvjTf6do9f4gDrT1U/FCzUvMxv2OSnpj6TukPZB74VUCix PSQtEy8n2+NVPdD416vafBce9aQn9b+fhOlaWKIJNU165pkuA12mimIZzrtgj9qmexnS RVYg== 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 y143si5539812qky.152.2019.03.14.07.45.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:41 -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-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) 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 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: , 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) Base macro to unify the actual testCompareXMLToArgv test calls Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 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 d5e02c26d8..a901582ef6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -842,23 +842,27 @@ mymain(void) * version. */ -# define DO_TEST_CAPS_INTERNAL(_name, arch, ver, ...) \ +# define TEST_INTERNAL(_name, _suffix, ...) \ do { \ static struct testInfo info = { \ .name = _name, \ - .suffix = "." arch "-" ver, \ + .suffix = _suffix, \ }; \ if (testInfoSetArgs(&info, capslatest, \ - ARG_CAPS_ARCH, arch, \ - ARG_CAPS_VER, ver, \ __VA_ARGS__, ARG_END) < 0) \ return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ + if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ testInfoClear(&info); \ } while (0) +# define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ + 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) @@ -885,19 +889,8 @@ mymain(void) /* 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 = { \ - .name = _name, \ - }; \ - if (testInfoSetArgs(&info, capslatest, \ - __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ - return EXIT_FAILURE; \ - if (virTestRun("QEMU XML-2-ARGV " _name, \ - testCompareXMLToArgv, &info) < 0) \ - ret = -1; \ - testInfoClear(&info); \ - } while (0) +# define DO_TEST_FULL(name, ...) \ + TEST_INTERNAL(name, "", __VA_ARGS__, QEMU_CAPS_LAST) # define DO_TEST(name, ...) \ DO_TEST_FULL(name, \