From nobody Mon Feb 9 14:33:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571827422; cv=none; d=zoho.com; s=zohoarc; b=HEV4plgevhtMvq/EI7Ej/iogeYDFtnjFdjWHREtFjwGECOjIcnpmk7Y3+8v2AGfFM1CFU5oeSoHo8S2+BxHZ0DDQybVnDBaW/1DfaBMppUyfRs/SA8kN9Xjh644cnidoH9UY8SMALUu2voTKuoGqohuKNJXWeqRnRT3NVvUYxRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571827422; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AHQ80fI4UbrMjV50/or8ha//Y6R0suKCVz72Spw6vX4=; b=jJrCwfLX2OJl6rQwNC41ddouj4TZmDZYexSLR0daZl3I80z4QTi/81S6nDRBBhkZ+Xr1AKLplAyGqcH99/jJXUwENFZp9o7VB9FEY1EWN6qLXLxz2AcIm9dpYo+zT1IUYUbBD4fLZTA3uYljAPsuz1UETSpKPR1TbVDpPqf2MHQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571827422309621.0984231711774; Wed, 23 Oct 2019 03:43:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-f5wV18ipP-mCy2sHAyB4JQ-1; Wed, 23 Oct 2019 06:43:36 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EC511005528; Wed, 23 Oct 2019 10:43:31 +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 D5B9360467; Wed, 23 Oct 2019 10:43:30 +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 94F614EE6D; Wed, 23 Oct 2019 10:43:30 +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 x9NAhRw5020331 for ; Wed, 23 Oct 2019 06:43:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id DF71FBAA2; Wed, 23 Oct 2019 10:43:27 +0000 (UTC) Received: from kinshicho.redhat.com (unknown [10.40.205.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A191BAA1 for ; Wed, 23 Oct 2019 10:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571827419; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AHQ80fI4UbrMjV50/or8ha//Y6R0suKCVz72Spw6vX4=; b=P6dw6Gys5NO7lWbnBHaHpHCJoFutNivY/rVT7bkF1ghWZ6e5XTTcQsQEMGGxG2NemHW3gr /91PsQOHItZT8GaV33S3NvL8sMoXXbfBWrUexGp3BlX9dRN1ex9GYu3WDOnQTP19WsYZlP m55XrJUtFLUn5yfqWzZwQCEdJOgE3kE= From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 23 Oct 2019 12:43:00 +0200 Message-Id: <20191023104302.26669-11-abologna@redhat.com> In-Reply-To: <20191023104302.26669-1-abologna@redhat.com> References: <20191023104302.26669-1-abologna@redhat.com> 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/12] tests/domaincaps: Don't require redundant information 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-MC-Unique: f5wV18ipP-mCy2sHAyB4JQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The full name of the test case, as well as the name of the QEMU binary and corresponding capabilities file, can all be derived from other information passed to the test, so there's no point in asking the user to provide them. Signed-off-by: Andrea Bolognani --- tests/domaincapstest.c | 127 ++++++++++++----------------------------- 1 file changed, 36 insertions(+), 91 deletions(-) diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index e35eddc659..e3329ef1ff 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -267,17 +267,23 @@ test_virDomainCapsFormat(const void *opaque) } =20 static int -doTestQemu(const char *partialName, - const char *capsName, - const char *emulator, +doTestQemu(const char *version, const char *machine, const char *arch, virDomainVirtType type, void *opaque) { g_autofree char *name =3D NULL; + g_autofree char *capsName =3D NULL; + g_autofree char *emulator =3D NULL; =20 - name =3D g_strdup_printf("qemu_%s.%s", partialName, arch); + name =3D g_strdup_printf("qemu_%s%s%s%s.%s", + version, + (type =3D=3D VIR_DOMAIN_VIRT_QEMU ? "-tcg" : ""= ), + (machine ? "-" : ""), (machine ? machine : ""), + arch); + capsName =3D g_strdup_printf("caps_%s", version); + emulator =3D g_strdup_printf("/usr/bin/qemu-system-%s", arch); =20 struct testData data =3D { .name =3D name, @@ -326,9 +332,9 @@ mymain(void) ret =3D -1; \ } while (0) =20 -#define DO_TEST_QEMU(Name, CapsName, Emulator, Machine, Arch, Type) \ +#define DO_TEST_QEMU(Version, Machine, Arch, Type) \ do { \ - if (doTestQemu(Name, CapsName, Emulator, Machine, Arch, Type, cfg)= < 0) \ + if (doTestQemu(Version, Machine, Arch, Type, cfg) < 0) \ ret =3D -1; \ } while (0) =20 @@ -378,101 +384,40 @@ mymain(void) virFileWrapperAddPrefix("/home/user/.config/qemu/firmware", abs_srcdir "/qemufirmwaredata/home/user/.confi= g/qemu/firmware"); =20 - DO_TEST_QEMU("1.7.0", "caps_1.7.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("1.7.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.6.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.8.0", "caps_2.8.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.7.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.8.0-tcg", "caps_2.8.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.8.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("2.8.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.9.0", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", "q35", "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.9.0", NULL, "x86_64", VIR_DOMAIN_VIRT_QEMU); =20 - DO_TEST_QEMU("2.9.0-q35", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", "q35", - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", "virt", "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("2.12.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.9.0-tcg", "caps_2.9.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_QEMU); + DO_TEST_QEMU("3.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("3.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-aarch64", NULL, - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.0.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.0.0", NULL, "s390x", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.6.0-virt", "caps_2.6.0", - "/usr/bin/qemu-system-aarch64", "virt", - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.1.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); =20 - DO_TEST_QEMU("2.12.0-virt", "caps_2.12.0", - "/usr/bin/qemu-system-aarch64", "virt", - "aarch64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.6.0", "caps_2.6.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.7.0", "caps_2.7.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.8.0", "caps_2.8.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("2.12.0", "caps_2.12.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("3.0.0", "caps_3.0.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("3.1.0", "caps_3.1.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.0.0", "caps_4.0.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.0.0", "caps_4.0.0", - "/usr/bin/qemu-system-s390x", NULL, - "s390x", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.1.0", "caps_4.1.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-x86_64", NULL, - "x86_64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-ppc64", NULL, - "ppc64", VIR_DOMAIN_VIRT_KVM); - - DO_TEST_QEMU("4.2.0", "caps_4.2.0", - "/usr/bin/qemu-system-aarch64", NULL, - "aarch64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "x86_64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "ppc64", VIR_DOMAIN_VIRT_KVM); + DO_TEST_QEMU("4.2.0", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); =20 virObjectUnref(cfg); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list