From nobody Wed May 14 14:25:42 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 152638165153460.93078975041874; Tue, 15 May 2018 03:54:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE0AB30C6DEB; Tue, 15 May 2018 10:54:09 +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 AB41130B2008; Tue, 15 May 2018 10:54:09 +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 27B85180B5B2; Tue, 15 May 2018 10:54:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4FAs0sa009518 for ; Tue, 15 May 2018 06:54:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 74B6160180; Tue, 15 May 2018 10:54:00 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D646600D1 for ; Tue, 15 May 2018 10:53:53 +0000 (UTC) Received: from shell.v3.sk (shell.v3.sk [92.60.52.57]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23108C0E90B5 for ; Tue, 15 May 2018 10:53:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 2D61EAC0FE for ; Tue, 15 May 2018 12:53:49 +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 q3oLBK6Uwdgw; Tue, 15 May 2018 12:53:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id F1EB2AC4EA; Tue, 15 May 2018 12:53:21 +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 TviLuB-itU3D; Tue, 15 May 2018 12:53:18 +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 D3177AC107; Tue, 15 May 2018 12:53:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk From: Lubomir Rintel To: libvir-list@redhat.com Date: Tue, 15 May 2018 12:53:08 +0200 Message-Id: <20180515105311.1981339-7-lkundrak@v3.sk> In-Reply-To: <20180515105311.1981339-1-lkundrak@v3.sk> References: <20180515105311.1981339-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.31]); Tue, 15 May 2018 10:53:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 15 May 2018 10:53:51 +0000 (UTC) for IP:'92.60.52.57' DOMAIN:'shell.v3.sk' HELO:'shell.v3.sk' FROM:'lkundrak@v3.sk' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 92.60.52.57 shell.v3.sk 92.60.52.57 shell.v3.sk X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Lubomir Rintel Subject: [libvirt] [PATCH 6/9] 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.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 15 May 2018 10:54:10 +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.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list