From patchwork Thu Mar 14 14:43:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160335 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594789jad; Thu, 14 Mar 2019 07:44:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2mvsrA1m/ELPM8nKMWWwEJsqV4onktrpGASmmRBglu5LqtCDgCetS7heuqaZQCC1fS8Cl X-Received: by 2002:ac8:2ce4:: with SMTP id 33mr39396184qtx.6.1552574666526; Thu, 14 Mar 2019 07:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574666; cv=none; d=google.com; s=arc-20160816; b=tHUzu90ZfzncwV5S9zhzllJYVjW+Mbjn79IDCYITru6D8zG0/WWdBSdY/YP7aDjsUW 5m2nqJuCFoiKAooL/ffmoet5ULpwmnGYnYWYL1a4v29BNDPr67fkN1NUqRjAZOSRGvjY WdUbdCruTTk2Fi1iCulwf8rB9JmyAc7ViWBnJcEApsT+RA2SIwkGRm+sp6gmmzVJ8Aqf hazz3iuC9CwYzGDmEOcPze2VAKgxugxyzQroeCP04jBpA+xAQZmqjS2e8e7tb12aEnZt AmSSJ6o6L2x+6CzboCqwr/pgVKsPI1bC0v1mHu5Or+na6cjuBIFndat4PzuooahuaCP8 lodg== 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:message-id:date:to:from:delivered-to; bh=k7pXIK10OQW1CcpEj0fbUj6es0bgxpD6pFysDAKJJws=; b=thwL4QtBTwaoulC7enhviHPWainGmty0wPOLrMC1h4LZ/iAtO9jJFNEEkgHm7Mk9xY x3AeWl+8A48VWu5snu1N7TYJWAY0UQCcK+u+Ieg6r8zOszxygxYvDHTx2x1DDpgcr44z vEXjXgOdM47KYOHtrcKxteMd6bDOn1rGdyWixMOGDJr/HBKO7ZQhzItAx7RKCjN9+c8T BUi38vavoRNE+MdtcBH0DXjJEu2DDJYT071WdnJSCFcEvYDCVZP0i9In7On41PfWpRg7 +6xyNZsUiNsZwCmpLK2U5nnORbUpYQxj23N5shM6jzrK9zibv0FU11MEpSTwhyeqy0MV r/0A== 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 z15si7857598qvg.36.2019.03.14.07.44.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:26 -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 EB480308FC5F; Thu, 14 Mar 2019 14:44:24 +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 6613A5D9C8; Thu, 14 Mar 2019 14:44:24 +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 5D6AA1819AFE; Thu, 14 Mar 2019 14:44:22 +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 x2EEiLU6024474 for ; Thu, 14 Mar 2019 10:44:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65CCC60FAB; Thu, 14 Mar 2019 14:44:21 +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 A830D60BE6; Thu, 14 Mar 2019 14:44:18 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:53 -0400 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 00/21] tests: qemuxml2argv: support optional arguments 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:44:25 +0000 (UTC) Right now in qemuxml2argv we have a proliferation of DO_*TEST* macros. They essentially fill in data in the testInfo struct and invoke the test function. There's several bits of data that we want to specify for a small subset of tests: flags, parseFlags, migrateFrom/migrateFd, gic. The base macros need to handle these in their argument lists, and we provide many convenience macros that fill in default values for the less common parameters. Any time we want to add a new bit of data though, the base macros are extended, and every caller of those needs to be adjusted, and we are faced with the question of whether to extend the combinatorial explosion of convenience macros which have only a subset of options exposed. This series adds a testInfoSetArgs which uses va_args to make these mandatory parameters optional. The general format is: DO_TEST_FULL(... ARG_FOO, foovalue, ARG_BAR, barvalue, ...) Specifically, one of the migrate tests went from: DO_TEST_FULL("restore-v2", "exec:cat", 7, 0, 0, GIC_NONE, NONE); to: DO_TEST_FULL("restore-v2", ARG_MIGRATE_FROM, "exec:cat", ARG_MIGRATE_FD, 7, ARG_QEMU_CAPS, NONE); Which may not seem directly compelling, but adding new testInfo fields will be much easier. This will also be a base for a later series to share the VIR_TEST_CAPS infrastructure with qemuxml2xmltest Cole Robinson (21): qemu: add virQEMUCapsSetVList tests: qemuxml2argv: add testInfoSetArgs tests: qemuxml2argv: add va_arg enum handling tests: qemuxml2argv: push ARG_QEMU_CAPS to callers tests: qemuxml2argv: break apart testInitQEMUCaps tests: qemuxml2argv: handle gic with vaargs tests: qemuxml2argv: handle migrate* with varargs tests: qemuxml2argv: handle flags with varargs tests: qemuxml2argv: handle parseFlags with varargs tests: qemuxml2argv: remove DO_TEST_PARSE_FLAGS_ERROR tests: qemuxml2argv: remove unused DO_TEST_CAPS* macros tests: qemuxml2argv: add a comment separating DO_TEST* macros tests: qemuxml2argv: remove unused CAPS migrateFrom tests: qemuxml2argv: use varargs for CAPS flags tests: qemuxml2argv: remove full testInfo initialization tests: qemuxml2argv: centralize CAPS suffix building tests: qemuxml2argv: build capsfile in DO_TEST_CAPS_INTERNAL tests: qemuxml2argv: add testInfoClear tests: qemuxml2argv: move DO_TEST qemuCaps init tests: qemuxml2argv: move DO_CAPS_TEST* qemuCaps init tests: qemuxml2argv: add TEST_INTERNAL src/qemu/qemu_capabilities.c | 14 +- src/qemu/qemu_capabilities.h | 2 + tests/qemuxml2argvtest.c | 273 +++++++++++++++++++++++------------ 3 files changed, 193 insertions(+), 96 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list