From nobody Fri Jul 4 08:38:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529008444500234.93580513848156; Thu, 14 Jun 2018 13:34:04 -0700 (PDT) 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 65C253082A36; Thu, 14 Jun 2018 20:34:03 +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 22C041092037; Thu, 14 Jun 2018 20:34:03 +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 A3D4418037ED; Thu, 14 Jun 2018 20:34:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5EKXNiU008193 for ; Thu, 14 Jun 2018 16:33:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9715BAC0ED; Thu, 14 Jun 2018 20:33:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7544ABF3C; Thu, 14 Jun 2018 20:33:21 +0000 (UTC) Received: from shell.v3.sk (shell.v3.sk [90.176.6.54]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 787268762C; Thu, 14 Jun 2018 20:33:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id F1120AE65D; Thu, 14 Jun 2018 22:33:18 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id kRdOuF1ofvKj; Thu, 14 Jun 2018 22:33:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id D0879AE65A; Thu, 14 Jun 2018 22:32:50 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id D8zmFCfPP6YT; Thu, 14 Jun 2018 22:32:46 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 49625AE668; Thu, 14 Jun 2018 22:32:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk From: Lubomir Rintel To: libvir-list@redhat.com Date: Thu, 14 Jun 2018 22:32:30 +0200 Message-Id: <20180614203233.3115735-9-lkundrak@v3.sk> In-Reply-To: <20180614203233.3115735-1-lkundrak@v3.sk> References: <20180614203233.3115735-1-lkundrak@v3.sk> X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Jun 2018 20:33:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Jun 2018 20:33:21 +0000 (UTC) for IP:'90.176.6.54' DOMAIN:'shell.v3.sk' HELO:'shell.v3.sk' FROM:'lkundrak@v3.sk' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 90.176.6.54 shell.v3.sk 90.176.6.54 shell.v3.sk X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Cc: Lubomir Rintel , Andrea Bolognani Subject: [libvirt] [PATCH v2 08/11] tests/util: add RISC-V capabilities 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.45]); Thu, 14 Jun 2018 20:34:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Lubomir Rintel --- tests/testutilsqemu.c | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index dc7e90b952..c6376262b9 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -28,6 +28,8 @@ typedef enum { TEST_UTILS_QEMU_BIN_ARM, TEST_UTILS_QEMU_BIN_PPC64, TEST_UTILS_QEMU_BIN_PPC, + TEST_UTILS_QEMU_BIN_RISCV32, + TEST_UTILS_QEMU_BIN_RISCV64, TEST_UTILS_QEMU_BIN_S390X } QEMUBinType; =20 @@ -38,6 +40,8 @@ static const char *QEMUBinList[] =3D { "/usr/bin/qemu-system-arm", "/usr/bin/qemu-system-ppc64", "/usr/bin/qemu-system-ppc", + "/usr/bin/qemu-system-riscv32", + "/usr/bin/qemu-system-riscv64", "/usr/bin/qemu-system-s390x" }; =20 @@ -285,6 +289,68 @@ static int testQemuAddPPCGuest(virCapsPtr caps) return -1; } =20 +static int testQemuAddRISCV32Guest(virCapsPtr caps) +{ + static const char *machine[] =3D { "spike_v1.10", + "spike_v1.9.1", + "sifive_e", + "virt", + "sifive_u" }; + virCapsGuestMachinePtr *machines =3D NULL; + virCapsGuestPtr guest; + + machines =3D virCapabilitiesAllocMachines(machine, 1); + if (!machines) + goto error; + + guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARC= H_RISCV32, + QEMUBinList[TEST_UTILS_QEMU_BIN_RISCV3= 2], + NULL, 1, machines); + if (!guest) + goto error; + + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, = NULL, 0, NULL)) + goto error; + + return 0; + + error: + /* No way to free a guest? */ + virCapabilitiesFreeMachines(machines, 1); + return -1; +} + +static int testQemuAddRISCV64Guest(virCapsPtr caps) +{ + static const char *machine[] =3D { "spike_v1.10", + "spike_v1.9.1", + "sifive_e", + "virt", + "sifive_u" }; + virCapsGuestMachinePtr *machines =3D NULL; + virCapsGuestPtr guest; + + machines =3D virCapabilitiesAllocMachines(machine, 1); + if (!machines) + goto error; + + guest =3D virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARC= H_RISCV64, + QEMUBinList[TEST_UTILS_QEMU_BIN_RISCV6= 4], + NULL, 1, machines); + if (!guest) + goto error; + + if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, = NULL, 0, NULL)) + goto error; + + return 0; + + error: + /* No way to free a guest? */ + virCapabilitiesFreeMachines(machines, 1); + return -1; +} + static int testQemuAddS390Guest(virCapsPtr caps) { static const char *s390_machines[] =3D { "s390-virtio", @@ -422,6 +488,12 @@ virCapsPtr testQemuCapsInit(void) if (testQemuAddPPCGuest(caps)) goto cleanup; =20 + if (testQemuAddRISCV32Guest(caps)) + goto cleanup; + + if (testQemuAddRISCV64Guest(caps)) + goto cleanup; + if (testQemuAddS390Guest(caps)) goto cleanup; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list