From nobody Mon Feb 9 00:53:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1641322488; cv=none; d=zohomail.com; s=zohoarc; b=VQCbNu7rC0v/SYDm+06gd+xpZ9ykrCRBT1LylZN5AlZQ0+uEqRTyD1p+TjpVVpGEm+hDVMHfYNRB+2OaHohnRORiXB7I8q6EPXvdMfobOydv6HK6h6lSfmWwqjjlJ/D+LgQ9HuPqPAz3sYS51tR1ZhQRI2VDKG7f+zpElPhnVpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322488; h=Content-Type:Content-Transfer-Encoding:Cc: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=/m87+cbLKOykaEQsmxs1ZgzyYElVO0y9kUZUZO3vvhM=; b=jTqBdXWEPgTL8vhWmTrbfcAi//LRe5kbyQ/M8ZsLbqeAzw5YDe90nMjgxpQJXcrX5wIgTQt6lJPfNd+iB6zEEt32BnyDzTGao/wQzvbvYspJSu6Qs21NX12o5+Cp1yA4bJVhMN43is9St4dAqPUV+bx1gn917k7E+bHXlkCejfU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1641322488614915.890233041302; Tue, 4 Jan 2022 10:54:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-oHH-Aq8RPvKhv4MPXd0JEQ-1; Tue, 04 Jan 2022 13:54:39 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 649E6802CB9; Tue, 4 Jan 2022 18:54:34 +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 433378E5F3; Tue, 4 Jan 2022 18:54: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 120D21806D1D; Tue, 4 Jan 2022 18:54:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 204IsWFq012988 for ; Tue, 4 Jan 2022 13:54:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 66EC534D53; Tue, 4 Jan 2022 18:54:32 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 657A934D41; Tue, 4 Jan 2022 18:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322487; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=/m87+cbLKOykaEQsmxs1ZgzyYElVO0y9kUZUZO3vvhM=; b=ICK27qN3UIfBtQZqq2p+BibZNHW55JfOSbEa7cRqkOKOfJmr2ONi4mjnpl9o4lYFC+qLaf 1IIjy5iURQBWkljBBDkj60TwQuN129qPOgKhiz1BGi5clhDd1ZLoUfOwr28PibvoMSNqsx oUyZ4zx0Eg/Ca5H7cmSiztFhaa8WAkU= X-MC-Unique: oHH-Aq8RPvKhv4MPXd0JEQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 11/17] tests: Add HVF support to testutilsqemu Date: Tue, 4 Jan 2022 19:52:50 +0100 Message-Id: <20220104185256.339072-12-abologna@redhat.com> In-Reply-To: <20220104185256.339072-1-abologna@redhat.com> References: <20220104185256.339072-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: r.bolshakov@yadro.com 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641322488942100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- tests/testutilsqemu.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 7fdb82daec..a75995c77a 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -106,6 +106,18 @@ static const char *const *kvm_machines[VIR_ARCH_LAST] = =3D { [VIR_ARCH_S390X] =3D s390x_machines, }; =20 +static const char *const *hvf_machines[VIR_ARCH_LAST] =3D { + [VIR_ARCH_I686] =3D NULL, + [VIR_ARCH_X86_64] =3D x86_64_machines, + [VIR_ARCH_AARCH64] =3D aarch64_machines, + [VIR_ARCH_ARMV7L] =3D NULL, + [VIR_ARCH_PPC64] =3D NULL, + [VIR_ARCH_PPC] =3D NULL, + [VIR_ARCH_RISCV32] =3D NULL, + [VIR_ARCH_RISCV64] =3D NULL, + [VIR_ARCH_S390X] =3D NULL, +}; + static const char *qemu_default_ram_id[VIR_ARCH_LAST] =3D { [VIR_ARCH_I686] =3D "pc.ram", [VIR_ARCH_X86_64] =3D "pc.ram", @@ -214,6 +226,18 @@ testQemuAddGuest(virCaps *caps, NULL, nmachines, machines); } =20 + if (hvf_machines[emu_arch] !=3D NULL) { + nmachines =3D g_strv_length((char **)hvf_machines[emu_arch]); + machines =3D virCapabilitiesAllocMachines(hvf_machines[emu_arch], + nmachines); + if (machines =3D=3D NULL) + goto error; + + virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HVF, + qemu_emulators[emu_arch], + NULL, nmachines, machines); + } + return 0; =20 error: @@ -403,6 +427,22 @@ int qemuTestCapsCacheInsert(virFileCache *cache, virQEMUCapsSet(tmpCaps, QEMU_CAPS_KVM); } } + if (hvf_machines[i] !=3D NULL) { + for (j =3D 0; hvf_machines[i][j] !=3D NULL; j++) { + virQEMUCapsAddMachine(tmpCaps, + VIR_DOMAIN_VIRT_HVF, + hvf_machines[i][j], + NULL, + NULL, + 0, + false, + false, + true, + defaultRAMid, + false); + virQEMUCapsSet(tmpCaps, QEMU_CAPS_HVF); + } + } } =20 if (virFileCacheInsertData(cache, qemu_emulators[i], tmpCaps) < 0)= { --=20 2.31.1