From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322410; cv=none; d=zohomail.com; s=zohoarc; b=clh0r1wKAPtOH+eLxXCZVviUXmZZATPULQOEo41pR60qQYe4QuXbIOOwPPv0jxESopRfZ614UYYsCx6qCaBkjQBRssjykwJJA3nQJf+DyyS7YlfbBlSi3TCUp8d7DvYdp2GCVZRbM3L48Pt3yxR0+yn8+M3dX5or4kEtLCah62w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322410; 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=LzzwiYtKY7aOchcNVS24BB2AQkoDb5fplkHqktg8Ey4=; b=LGWIrhK8WjwoWg6C3VLvY+GIVxBNnUR+Q1XV0Is/DVCdj28nCj3NxW8+iS/2mr9dFap80zh2GcUy/+j56jVaWqXL/A2wE2V7U9doei/4Nzh0KSwf0JSB3bBfqXZlXnbqQXMdMtHQ62+7e7XlO+ec5cKifOt+eOqzX5rOHDlJJm4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641322410423826.0383283161501; Tue, 4 Jan 2022 10:53:30 -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-387-63vZ0bS8PE67kXTOxGuYww-1; Tue, 04 Jan 2022 13:53:25 -0500 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 2E838101AFA8; Tue, 4 Jan 2022 18:53:19 +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 94BC47EF53; Tue, 4 Jan 2022 18:53:18 +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 BE6DD4A7C8; Tue, 4 Jan 2022 18:53:17 +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 204IrG4f012611 for ; Tue, 4 Jan 2022 13:53:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id A4F2F38DE9; Tue, 4 Jan 2022 18:53:16 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BDD134D4E; Tue, 4 Jan 2022 18:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322409; 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=LzzwiYtKY7aOchcNVS24BB2AQkoDb5fplkHqktg8Ey4=; b=aH9jwWJ/O9AKLpOEXs6WtXg86FVlgRKmUKpadbyh0z2RpJKmx5j2/5IV+Y+bV+7bYrmpKh YjAosFeyxF2HBPPCHMRf8ktGbUh6gP6FBPRAG4pk+Pjp+ful5AoVVmbT1QHxpo3GRtzbZu 6g3aQq7XhcqTTbCSayfssqJEXZYOalU= X-MC-Unique: 63vZ0bS8PE67kXTOxGuYww-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 01/17] conf: Add hvf domain type Date: Tue, 4 Jan 2022 19:52:40 +0100 Message-Id: <20220104185256.339072-2-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.11 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: 1641322411438100003 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov QEMU supports Hypervisor.framework since 2.12 as hvf accel. Hypervisor.framework provides a lightweight interface to run a virtual cpu on macOS without the need to install third-party kernel extensions (KEXTs). It's supported since macOS 10.10 on machines with Intel VT-x feature set that includes Extended Page Tables (EPT) and Unrestricted Mode. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/formatdomain.rst | 3 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 4 ++++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..3e9de05249 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -20,7 +20,8 @@ Element and attribute overview =20 The root element required for all virtual machines is named ``domain``. It= has two attributes, the ``type`` specifies the hypervisor used for running the -domain. The allowed values are driver specific, but include "xen", "kvm", = "qemu" +domain. The allowed values are driver specific, but include "xen", "kvm", +"hvf" (:since:`since 8.0.0 and QEMU 2.12`), "qemu" and "lxc". The second attribute is ``id`` which is a unique integer identi= fier for the running guest machine. Inactive machines have no id value. =20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7fa5c2b8b5..bf9c12397f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -230,6 +230,7 @@ phyp vz bhyve + hvf diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5691b8d2d5..0faecf2bb4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -125,6 +125,7 @@ VIR_ENUM_IMPL(virDomainVirt, "parallels", "bhyve", "vz", + "hvf", ); =20 VIR_ENUM_IMPL(virDomainOS, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..d4d8aa7e23 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -139,6 +139,7 @@ typedef enum { VIR_DOMAIN_VIRT_PARALLELS, VIR_DOMAIN_VIRT_BHYVE, VIR_DOMAIN_VIRT_VZ, + VIR_DOMAIN_VIRT_HVF, =20 VIR_DOMAIN_VIRT_LAST } virDomainVirtType; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d822533ccb..3bacf3edf2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7229,6 +7229,10 @@ qemuBuildAccelCommandLine(virCommand *cmd, } break; =20 + case VIR_DOMAIN_VIRT_HVF: + virBufferAddLit(&buf, "hvf"); + break; + case VIR_DOMAIN_VIRT_KQEMU: case VIR_DOMAIN_VIRT_XEN: case VIR_DOMAIN_VIRT_LXC: --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322422; cv=none; d=zohomail.com; s=zohoarc; b=iU0CJXt6Keh0QX9hSyqJj/NZxRqA90DKHqmEcb2QsMayfgIpkSa6I0Ad9a0LXUEJ/Hxb0g3tQumMnTdNtutn7WV0yipjZK07pTUK/iqAxRTU4RzpX9jYNSfqtu7OYdoa0swaiIWxhSHdNluICUcxTqH6HXid3xT+E2C7d5+4qAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322422; 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=8v87r4qq36uamfxA+maPinwxzGsJxpf8EXzflxEd2DI=; b=Kwh9UUW97fPnXBYYro3Vg7cUvL6laxOZGEKBYw4/A5pXlKLXD+udO25tDG9Jns8JiF2Gaw+cYtNAN6ru9nckHHYFCdGDuJjybs+wI3p69j3ZWbXeEXdViZs3mkJJLqjnfBaT4axSxt7Jn5JAg8u+86gne0R3XcQDfOKDVidVTS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 164132242252123.789704424249976; Tue, 4 Jan 2022 10:53:42 -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-541-36iGoCymP8OZzwqt_Wga3Q-1; Tue, 04 Jan 2022 13:53:40 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6AB86802CBA; Tue, 4 Jan 2022 18:53:33 +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 4D3A17A41A; Tue, 4 Jan 2022 18:53:33 +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 DBA041809CB9; Tue, 4 Jan 2022 18:53:32 +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 204IrLUG012621 for ; Tue, 4 Jan 2022 13:53:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 54C0E34D4E; Tue, 4 Jan 2022 18:53:21 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73C7538E00; Tue, 4 Jan 2022 18:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322421; 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=8v87r4qq36uamfxA+maPinwxzGsJxpf8EXzflxEd2DI=; b=GNSKpNyeBeZCDgDglTIjevYD5CfSSL19qQ1O/ZtT70YcwfMo/aV3xzFMrQaW7+7+V73nGT k7VtG9q83WtjZ00oKlKIDjhOUdgpyCqERNYz+z1N0vTLIWXyfZxQRI0BlrYljs0xpZVPQh kntIYhxSPzQE8wWpIEe5O06nqphZ/uw= X-MC-Unique: 36iGoCymP8OZzwqt_Wga3Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 02/17] qemu: Define hvf capability Date: Tue, 4 Jan 2022 19:52:41 +0100 Message-Id: <20220104185256.339072-3-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.14 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: 1641322422978100001 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4f63322a9e..7823cb3d48 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -653,6 +653,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "query-dirty-rate", /* QEMU_CAPS_QUERY_DIRTY_RATE */ "rbd-encryption", /* QEMU_CAPS_RBD_ENCRYPTION */ "sev-guest-kernel-hashes", /* QEMU_CAPS_SEV_GUEST_KERNEL_HAS= HES */ + "hvf", /* QEMU_CAPS_HVF */ ); =20 =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index aaac20a834..4ffec44f6d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -632,6 +632,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_QUERY_DIRTY_RATE, /* accepts query-dirty-rate */ QEMU_CAPS_RBD_ENCRYPTION, /* Ceph RBD encryption support */ QEMU_CAPS_SEV_GUEST_KERNEL_HASHES, /* sev-guest.kernel-hashes=3D */ + QEMU_CAPS_HVF, /* Whether Hypervisor.framework is available */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322505; cv=none; d=zohomail.com; s=zohoarc; b=oDgSpINPqLahSZF6cVnD2dPPIm88xO1QH3kw+JputizPvb4MJPeLwAcRb+9Ip27YKtAprMpMfMHfnabvP0TWrR1P1hOHUkWePbMDZuJbeWhgWVXIk/plNGLzKGOHBINvsviQsDcH9wyqcnSZsH8lLbEsOmKip4UUu85IpSTHm5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322505; 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=Ak3uh9uAaO7wS9ENfXwycAUALlTfB8wTzTKUviGSK4w=; b=m9w3yzzYkGdhttYTFXRywoJck5oZ/Jf9Famkhepgc7gqzifKwA9qQGjlgfuFRLncRDXIPceuCsIoebN6CX8glPFsk3AcP1mgvQLG+V3rkE51jjgOmtS6K/YE9m9w+CB+uEaDuIjhEUzim9MEEcXlr3xCt2ibfTLlrik91hH/OI0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641322505546169.00640812589563; Tue, 4 Jan 2022 10:55:05 -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-658-MsvpTxcMPuC7mwY2ybrHNA-1; Tue, 04 Jan 2022 13:53:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62F2810168DA; Tue, 4 Jan 2022 18:53:33 +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 4395478A33; Tue, 4 Jan 2022 18:53:33 +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 E36791809CBA; Tue, 4 Jan 2022 18:53:32 +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 204IrMwp012626 for ; Tue, 4 Jan 2022 13:53:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id D686938E00; Tue, 4 Jan 2022 18:53:22 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF83234D4E; Tue, 4 Jan 2022 18:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322504; 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=Ak3uh9uAaO7wS9ENfXwycAUALlTfB8wTzTKUviGSK4w=; b=ZV+SNs4vmk3UvqcBSITyahvfX3H0Hobt9rKBNd8GQf2X6PcVxNOJsVmrp7r6ktvPb0Pg01 r/sgniSc8xocwV47C5xiR927DJFBsBBRjfpdG0wH5XBzDgNHxynOarPaihBhHP5IpT6oWd Xeq+J7Au9nTrD2nqNeFW8UEMnE2lzV4= X-MC-Unique: MsvpTxcMPuC7mwY2ybrHNA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 03/17] qemu: Query hvf capability on macOS Date: Tue, 4 Jan 2022 19:52:42 +0100 Message-Id: <20220104185256.339072-4-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.15 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: 1641322507718100001 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov There's no QMP command for querying if hvf is supported, therefore we use sysctl interface that tells if Hypervisor.framework works/available on the host. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 7823cb3d48..9b4f695770 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -56,6 +56,10 @@ #include #include #include +#ifdef __APPLE__ +# include +# include +#endif =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 @@ -3191,6 +3195,32 @@ virQEMUCapsProbeQMPKVMState(virQEMUCaps *qemuCaps, return 0; } =20 +#ifdef __APPLE__ +static int +virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps) +{ + int hv_support; + size_t len =3D sizeof(hv_support); + + if (sysctlbyname("kern.hv_support", &hv_support, &len, NULL, 0) < 0) + hv_support =3D 0; + + if (qemuCaps->version >=3D 2012000 && + ARCH_IS_X86(qemuCaps->arch) && + hv_support) { + virQEMUCapsSet(qemuCaps, QEMU_CAPS_HVF); + } + + return 0; +} +#else +static int +virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps G_GNUC_UNUSED) +{ + return 0; +} +#endif + struct virQEMUCapsCommandLineProps { const char *option; const char *param; @@ -5335,6 +5365,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCaps *qemuCaps, if (virQEMUCapsProbeQMPKVMState(qemuCaps, mon) < 0) return -1; =20 + if (virQEMUCapsProbeHVF(qemuCaps) < 0) + return -1; + type =3D virQEMUCapsGetVirtType(qemuCaps); accel =3D virQEMUCapsGetAccel(qemuCaps, type); =20 --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322472; cv=none; d=zohomail.com; s=zohoarc; b=LewPVW+S0lZ71E0VzYTf+Zu2srThs22/JSW5Wqfg97W8af0ybQ0kjsNiHOcDF46K/MFxo5gSAlrWt/wyxKVY11jSCnizn1WQYk4Gp/pvC3eM4T1GpV0wMgHTFSMuPn0t6QUd8JqgbZ06b51kE9vU3pyH8tQOsnIHXD+qU50tZMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322472; 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=EEnydQH7boxBKo4mXtbvJaXFmVzcJ12P0HwhsaKoYMU=; b=MP1KayrDl7R5QxdudbA6w45StSToQZvE+H7YCw9SVx/B3vcepVnMzT8sDmNRG/OqD/yoJil1LOjo/V9Jtx+V+30y5lewVEr3ffH0bFd9SlO7f62qstctBz0BCGQl8kdUFzPEefNPohCanAsGfLu9C8s0GKhZaIQ3zU2AquFgD30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641322472063996.8350149488218; Tue, 4 Jan 2022 10:54:32 -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-383-4drmqjXlNkiSqw2D2yZkPg-1; Tue, 04 Jan 2022 13:54:27 -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 3CE371052BBA; Tue, 4 Jan 2022 18:54:21 +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 E74AF8E5F3; Tue, 4 Jan 2022 18:54:20 +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 B710A4A7C9; Tue, 4 Jan 2022 18:54:19 +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 204IsHEg012890 for ; Tue, 4 Jan 2022 13:54:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id D539834D4E; Tue, 4 Jan 2022 18:54:17 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4ED234D41; Tue, 4 Jan 2022 18:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322471; 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=EEnydQH7boxBKo4mXtbvJaXFmVzcJ12P0HwhsaKoYMU=; b=h/ajMojV5Va+0ndwWQwmDBBU0HAFkfIyHyCO/hHdlKnAMgEguFdd+MTvPj/v2/xJdHFLTc bxtW06jKolF3ODGCw0tyxo5VW7TtBEJ3x3SKxImFPHfi4mJTFWqkpzk8UbxbYAmKcDn5qH 2QTlwZthh6VNqZpilldPCeHsI+vo8TQ= X-MC-Unique: 4drmqjXlNkiSqw2D2yZkPg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 04/17] qemu: Expose hvf domain type if hvf is supported Date: Tue, 4 Jan 2022 19:52:43 +0100 Message-Id: <20220104185256.339072-5-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641322473888100003 From: Roman Bolshakov Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9b4f695770..ca060485fa 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1081,6 +1081,10 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM, NULL, NULL, 0, NULL); } + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) { + virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HVF, + NULL, NULL, 0, NULL); + } =20 if ((ARCH_IS_X86(guestarch) || guestarch =3D=3D VIR_ARCH_AARCH64)) virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEA= TURE_TYPE_ACPI, --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 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=1641322471; cv=none; d=zohomail.com; s=zohoarc; b=QCG7GFxOY5QeVfRa0Atndmkxrpjw5xnF8rL9wdAfXf5TSIAVbAtUotTJzlQcrwCS/LUeOjZ8AnOE4uevTBmgHYOkQCG4sD8sQJFSbok2VQqJHdaRwgmLhAwvjoqcM83Nep0JIEBJDSY5k0ceekDKjols9X4J1eABcuYIowHPSX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322471; 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=j5xc9LVXIFbbDxBzzEwP+LfbM8UzChDYHMmy4wQ5Zbc=; b=GZ7G9RGaERPbp2jai7UMnGnCn9MSHHvBfW1EoHIE78pEp5uD4/fAV2cfOqdzh7oMfrMMzLdgi8OoohalO6jqcx6VhhNjwe68aJSuscC4wKWdoLdNEV6EBnU32mFnsiptGri1kEz82XRZQaAU7aI4JEGluNbfLm7v/h8GzZfx/lQ= 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 1641322471208995.2386481746817; Tue, 4 Jan 2022 10:54:31 -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-266-Y8p8H9aGNRSXaSMcdquMng-1; Tue, 04 Jan 2022 13:54:28 -0500 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 8592F1DDF2; Tue, 4 Jan 2022 18:54:22 +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 6445F7EE96; Tue, 4 Jan 2022 18:54:22 +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 2D9AD4A7CA; Tue, 4 Jan 2022 18:54:22 +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 204IsJho012896 for ; Tue, 4 Jan 2022 13:54:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4B2C334D4E; Tue, 4 Jan 2022 18:54:19 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58E6434D41; Tue, 4 Jan 2022 18:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322470; 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=j5xc9LVXIFbbDxBzzEwP+LfbM8UzChDYHMmy4wQ5Zbc=; b=LsAM0ajX7pK3AU6/n//EgiK2DF1/ZCYNLbGs+L/WwYeE1wlZKXw9qSff8IoVfxmNg5lJUY n4Gyod+GOwUHM4qrSPJFKCuz5OL4dCpCeHuOIFZQhkfrEQDRgcf6YHKQalSyivwQ+DxuBW SKvapej5JuaAdrj2caKJfLITD2i4drw= X-MC-Unique: Y8p8H9aGNRSXaSMcdquMng-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 05/17] qemu: Introduce virQEMUCapsTypeIsAccelerated Date: Tue, 4 Jan 2022 19:52:44 +0100 Message-Id: <20220104185256.339072-6-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.11 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: 1641322471849100001 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov It replaces hardcoded checks that select accelCPU/accelCPUModels (formerly known as kvmCPU/kvmCPUModels) for KVM. It'll be cleaner to use the function when multiple accelerators are supported in qemu driver. Explicit KVM domain checks should be done only when a feature is available only for KVM. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ca060485fa..e2ce2a5d07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -788,6 +788,11 @@ const char *virQEMUCapsArchToString(virArch arch) return virArchToString(arch); } =20 +static bool +virQEMUCapsTypeIsAccelerated(virDomainVirtType type) +{ + return type =3D=3D VIR_DOMAIN_VIRT_KVM; +} =20 /* Checks whether a domain with @guest arch can run natively on @host. */ @@ -2328,7 +2333,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCaps *qemuCaps, =20 switch (mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: - return type =3D=3D VIR_DOMAIN_VIRT_KVM && + return virQEMUCapsTypeIsAccelerated(type) && virQEMUCapsGuestIsNative(hostarch, qemuCaps->arch); =20 case VIR_CPU_MODE_HOST_MODEL: @@ -2990,7 +2995,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps, qemuMonitor *mon, virDomainVirtType virtType) { - const char *model =3D virtType =3D=3D VIR_DOMAIN_VIRT_KVM ? "host" : "= max"; + const char *model =3D virQEMUCapsTypeIsAccelerated(virtType) ? "host" = : "max"; g_autoptr(qemuMonitorCPUModelInfo) modelInfo =3D NULL; g_autoptr(qemuMonitorCPUModelInfo) nonMigratable =3D NULL; g_autoptr(GHashTable) hash =3D NULL; @@ -3700,7 +3705,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, virArchToString(qemuCaps->arch), virDomainVirtTypeToString(type)); goto error; - } else if (type =3D=3D VIR_DOMAIN_VIRT_KVM && + } else if (virQEMUCapsTypeIsAccelerated(type) && virCPUGetHostIsSupported(qemuCaps->arch)) { if (!(fullCPU =3D virQEMUCapsProbeHostCPU(qemuCaps->arch, NULL))) goto error; @@ -5827,7 +5832,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache, if (virttype =3D=3D VIR_DOMAIN_VIRT_NONE) virttype =3D capsType; =20 - if (virttype =3D=3D VIR_DOMAIN_VIRT_KVM && capsType =3D=3D VIR_DOMAIN_= VIRT_QEMU) { + if (virQEMUCapsTypeIsAccelerated(virttype) && capsType =3D=3D VIR_DOMA= IN_VIRT_QEMU) { virReportError(VIR_ERR_INVALID_ARG, _("KVM is not supported by '%s' on this host"), binary); --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322472; cv=none; d=zohomail.com; s=zohoarc; b=R/jFuSwBySKK6fINZS0776Pl/i+vj3M9VrZQce4rMyi/Rakw3CJZ/unRztjyVp6641GWwLUH1tRogH9lyU3RVgkFJzA484UFakjD8b7hvcAeWNbttyTuZjqRdIEkOuSGV8g7+ejbSAlj+15lKj9I946iSXODU6Bu8CjcKv5SMag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322472; 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=XHCuBbhY/KwfCiPJnk/k4FOwb/VqasIhwD2rNsAZOtw=; b=kseZ4fHSBcD55wgStdHBo3NkZSnd4lM7BuHmEUzG467fWRiGU3BWEqUKVKd5fJuVUauZufTvUnYkOj/JJhpBKMeHgmEzbKrPtb22cd5CDr6pTSJPc0pT+Ojmam5dU+ui0SPnUDutVwVZd4V/R2iGX0440QrudTxVU7rMic4i1zA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641322472294603.3322955073835; Tue, 4 Jan 2022 10:54:32 -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-227-xf_YSFReOs2V2jVXuWn5hg-1; Tue, 04 Jan 2022 13:54:29 -0500 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 E5B62100CFBE; Tue, 4 Jan 2022 18:54:23 +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 C11A37ED85; Tue, 4 Jan 2022 18:54:23 +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 8B50418077BC; Tue, 4 Jan 2022 18:54:23 +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 204IsKYh012908 for ; Tue, 4 Jan 2022 13:54:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id E5E0034D41; Tue, 4 Jan 2022 18:54:20 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C64A134D5E; Tue, 4 Jan 2022 18:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322471; 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=XHCuBbhY/KwfCiPJnk/k4FOwb/VqasIhwD2rNsAZOtw=; b=AhTy1rGZujjSDRev7LHbLdL/WeEswjchUe7YVastU0L4aNUZDaoSMK9RwUTweGaJYov/WU VfJvi2oE9riHl5/Zr0u5pqGJTgR4pcTSuzMVctXui81ZVVAlXfQqaT6cJbA9p+bzW/PTdR bRGEjpXjXW9lyiDQH0HWQb8HbbdoYd8= X-MC-Unique: xf_YSFReOs2V2jVXuWn5hg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 06/17] qemu: Introduce virQEMUCapsHaveAccel Date: Tue, 4 Jan 2022 19:52:45 +0100 Message-Id: <20220104185256.339072-7-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.11 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: 1641322473891100004 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov The function should be used to check if qemu capabilities include a hardware acceleration, i.e. accel is not TCG. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e2ce2a5d07..b504963ddf 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -794,6 +794,12 @@ virQEMUCapsTypeIsAccelerated(virDomainVirtType type) return type =3D=3D VIR_DOMAIN_VIRT_KVM; } =20 +static bool +virQEMUCapsHaveAccel(virQEMUCaps *qemuCaps) +{ + return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); +} + /* Checks whether a domain with @guest arch can run natively on @host. */ bool @@ -4999,7 +5005,7 @@ virQEMUCapsIsValid(void *data, return false; } =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { + if (virQEMUCapsHaveAccel(qemuCaps)) { if (STRNEQ_NULLABLE(priv->hostCPUSignature, qemuCaps->hostCPUSigna= ture)) { VIR_DEBUG("Outdated capabilities for '%s': host CPU changed " "('%s' vs '%s')", @@ -5033,7 +5039,9 @@ virQEMUCapsIsValid(void *data, qemuCaps->binary); return false; } + } =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); if (kvmSupportsNesting !=3D qemuCaps->kvmSupportsNesting) { VIR_DEBUG("Outdated capabilities for '%s': kvm kernel nested " @@ -5498,7 +5506,7 @@ virQEMUCapsInitQMP(virQEMUCaps *qemuCaps, * for TCG capabilities by asking the same binary again and turning KVM * off. */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && + if (virQEMUCapsHaveAccel(qemuCaps) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG) && virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) <= 0) return -1; @@ -5561,13 +5569,15 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { + if (virQEMUCapsHaveAccel(qemuCaps)) { qemuCaps->hostCPUSignature =3D g_strdup(hostCPUSignature); qemuCaps->microcodeVersion =3D microcodeVersion; qemuCaps->cpuData =3D virCPUDataNewCopy(cpuData); =20 qemuCaps->kernelVersion =3D g_strdup(kernelVersion); + } =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { qemuCaps->kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); =20 qemuCaps->kvmSupportsSecureGuest =3D virQEMUCapsKVMSupportsSecureG= uest(); --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 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=1641322476; cv=none; d=zohomail.com; s=zohoarc; b=RaIC6BTK21lZKJY8fk8FOvwDKaeKmBH+cU4vUSsMg1id0p8SFzpe8vqRWunI1/A8R34R1sMU8Z2akaECPnQYGYvpVvcd9VZgDa2Uu6vIcCTNwWVuZx42djDj2JNa2F5mo8MTvCXEnbsxZPP350zgsivufiG8xl8WumeRAMSRd1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322476; 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=hAaSvkISZjpMSu6SGmb5bDt6wX1rCUECakFEJ65rZUY=; b=jFulUpP/ftUIukTt5JuoDtA0diPVM5GhadNM4cHb0WVLFxgCxuBTpiKGuVx9GXLKXDT5P8CyFxzVTxjRp8Q1GApdpe5BGDOsXl8exMHfcpfxUeNIn1DGbQinrJdHOhT+wfr/qdml0eVBsmbEewQh7Uh3FqniORpdeka67B907Dw= 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 1641322476492265.30437687802; Tue, 4 Jan 2022 10:54:36 -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-118-5m-2tFzsPm6imWxapn_zSg-1; Tue, 04 Jan 2022 13:54:30 -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 6CD2181433C; Tue, 4 Jan 2022 18:54:25 +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 071609325F; Tue, 4 Jan 2022 18:54:25 +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 BF14A4A7CD; Tue, 4 Jan 2022 18:54:24 +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 204IsMZ1012924 for ; Tue, 4 Jan 2022 13:54:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7598E34D4E; Tue, 4 Jan 2022 18:54:22 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E7E434D41; Tue, 4 Jan 2022 18:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322475; 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=hAaSvkISZjpMSu6SGmb5bDt6wX1rCUECakFEJ65rZUY=; b=LI94UGSpzFMTDcRYmlGWF9WDDcWxbm3mlHJvLQsk6onzlGWLHsFeLUL4y1N3Suxq5Scy4Y zuu0t5ZnVerX39PfawUVhbuNEOhRCZbYfGb0MJAk9TLvhjwf97XOUeO6QvQHkWTpzQYT/Z HzdMOmm4YPhxpC/rOAbKIpQCE57VYQQ= X-MC-Unique: 5m-2tFzsPm6imWxapn_zSg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 07/17] qemu: Introduce virQEMUCapsAccelStr Date: Tue, 4 Jan 2022 19:52:46 +0100 Message-Id: <20220104185256.339072-8-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: 1641322478375100002 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov This makes possible to add more accelerators by touching less code and reduces code duplication. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b504963ddf..eac1e65a39 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -800,6 +800,16 @@ virQEMUCapsHaveAccel(virQEMUCaps *qemuCaps) return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); } =20 +static const char * +virQEMUCapsAccelStr(virDomainVirtType type) +{ + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { + return "kvm"; + } else { + return "tcg"; + } +} + /* Checks whether a domain with @guest arch can run natively on @host. */ bool @@ -4075,7 +4085,7 @@ virQEMUCapsLoadAccel(virQEMUCaps *qemuCaps, virDomainVirtType type) { virQEMUCapsAccel *caps =3D virQEMUCapsGetAccel(qemuCaps, type); - const char *typeStr =3D type =3D=3D VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg= "; + const char *typeStr =3D virQEMUCapsAccelStr(type); =20 if (virQEMUCapsLoadHostCPUModelInfo(caps, ctxt, typeStr) < 0) return -1; @@ -4624,7 +4634,7 @@ virQEMUCapsFormatAccel(virQEMUCaps *qemuCaps, virDomainVirtType type) { virQEMUCapsAccel *caps =3D virQEMUCapsGetAccel(qemuCaps, type); - const char *typeStr =3D type =3D=3D VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg= "; + const char *typeStr =3D virQEMUCapsAccelStr(type); =20 virQEMUCapsFormatHostCPUModelInfo(caps, buf, typeStr); virQEMUCapsFormatCPUModels(caps, buf, typeStr); --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 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=1641322476; cv=none; d=zohomail.com; s=zohoarc; b=ORSslQjZnWvWft59MRsULJ0DeT+qg2g7xObTXdKXbmcMmcPVVXDyo5sDBxcsBe9lHNpjudX7JSGEJauwBqG710hDAm54PkYkXthXl2kjai9ep3hsQWMgBfpne7UhpG7AvOOvC19qREPbQpmM2SPBSRe66RxQxOvu1blzUyysWNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322476; 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=rZUAwNQy5pq3JBRdSH9FitvdFFubOs//srSRkE8Rjcg=; b=TFnhwDwS8kewnhEGa5JEUX4GqIay/MCCUe2sExeBVmQ1UMtoYyD3xKFwD963awnsz6jrmAXFAQD8+m0506KU9ccISAPjcgz+LPe2au35ArH5Z0op9PquNbTogUEqEDI8GytybCEUgMMusyQkR5rf4/WorD76wAKQn02+OxChgHI= 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 1641322476277233.40705257170657; Tue, 4 Jan 2022 10:54:36 -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-408-5bG1ioOwPceHjk-Z7Peyww-1; Tue, 04 Jan 2022 13:54:31 -0500 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 B1FD51054F9F; Tue, 4 Jan 2022 18:54:26 +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 440C77ED85; Tue, 4 Jan 2022 18:54:26 +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 F10F41806D03; Tue, 4 Jan 2022 18:54:25 +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 204IsOIN012942 for ; Tue, 4 Jan 2022 13:54:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 179CF34D4E; Tue, 4 Jan 2022 18:54:24 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1C9434D41; Tue, 4 Jan 2022 18:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322475; 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=rZUAwNQy5pq3JBRdSH9FitvdFFubOs//srSRkE8Rjcg=; b=AoROahCDU7fLhI4j5esUd2o8IBbJWILZYaBnqrunCJdkeQQMW7z8dXW0B9hauMJ+LjYmeu 9qVrGp3V5+jbO4iY7MmbM2Lwp7Pw10D9BS9WhWzCJCjTsiqhovbv2zNgVVN59F2GpCTUHl NnPcbUom/Tnp0webmYHiUqwHjHBurQ4= X-MC-Unique: 5bG1ioOwPceHjk-Z7Peyww-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 08/17] qemu: Make error message accel-agnostic Date: Tue, 4 Jan 2022 19:52:47 +0100 Message-Id: <20220104185256.339072-9-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.11 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: 1641322478360100001 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov With more acceleration types, KVM should be used only in error messages related to KVM. Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index eac1e65a39..893af0b635 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5854,8 +5854,8 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache, =20 if (virQEMUCapsTypeIsAccelerated(virttype) && capsType =3D=3D VIR_DOMA= IN_VIRT_QEMU) { virReportError(VIR_ERR_INVALID_ARG, - _("KVM is not supported by '%s' on this host"), - binary); + _("the accel '%s' is not supported by '%s' on this = host"), + virQEMUCapsAccelStr(virttype), binary); return NULL; } =20 --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641322574; cv=none; d=zohomail.com; s=zohoarc; b=nnykfFYscrNhJVacjUalw+07tUZTWiaVyKPWQ4XdY143ClsUN9Amx5gVbNGwsNcYCI0ht++vCEE1RXNRr58jebinclIwnlA1ODWgtQp0DtaTQHirdhipMuAzsCtLiC45vTBTZ+I3HMQdqtYMiTjwoSLu0sLMSo45iKrUzGAFAgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322574; 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=Go2/lma2vhNiqVmWpRbgEXbkzfqIxdnfp2MJIb/V/xg=; b=gCf6vJmDzPZHSwQFyTR1OJXlsObKufEUNHHUc2mNSzn557NKzQLEfNyOju1tb//tMMehvPrF2Immr0sSi5qst+e6Ri62qfQbSjdkpIdalJUyyAx5XkE3fDkNib6z1g7PFFk/P2m5VRd2sEyuX+I02G4CqnnjVU9Yn6ejRUKhrto= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641322574144370.0207712887337; Tue, 4 Jan 2022 10:56:14 -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-522-q_U2kV9NOJu7BGbZImAMaw-1; Tue, 04 Jan 2022 13:54:37 -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 5E8A910557DB; Tue, 4 Jan 2022 18:54:30 +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 3C0A48E5F3; Tue, 4 Jan 2022 18:54: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 0998B4A7CA; Tue, 4 Jan 2022 18:54:30 +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 204IsTb1012962 for ; Tue, 4 Jan 2022 13:54:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D3AD34D4E; Tue, 4 Jan 2022 18:54:29 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B81534D41; Tue, 4 Jan 2022 18:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322573; 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=Go2/lma2vhNiqVmWpRbgEXbkzfqIxdnfp2MJIb/V/xg=; b=DbGfjKbAqkN21Tjp9OErL/7GTJo5EAw4Ms9kYYzhEXHcaWdwmtPeWKDQjv0s8KRv66kVSI 1klpnZvO5CcBOZHUGgxmaK54G+5EOAcdzKnNTAYcEcgu1g2IsSdEX+m8yLxyUqC9xWwwzU qqEaSmXAmaQyxwejbxVen5Mzcj+br8U= X-MC-Unique: q_U2kV9NOJu7BGbZImAMaw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 09/17] qemu: Correct CPU capabilities probing for hvf Date: Tue, 4 Jan 2022 19:52:48 +0100 Message-Id: <20220104185256.339072-10-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: 1641322575147100001 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov With this change virsh domcapabilites shows: https://gitlab.com/libvirt/libvirt/-/issues/147 Signed-off-by: Roman Bolshakov Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 25 ++++++++++++++++++++++--- src/qemu/qemu_process.c | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 893af0b635..c2ae87d747 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -741,6 +741,7 @@ struct _virQEMUCaps { =20 /* Capabilities which may differ depending on the accelerator. */ virQEMUCapsAccel kvm; + virQEMUCapsAccel hvf; virQEMUCapsAccel tcg; }; =20 @@ -791,13 +792,15 @@ const char *virQEMUCapsArchToString(virArch arch) static bool virQEMUCapsTypeIsAccelerated(virDomainVirtType type) { - return type =3D=3D VIR_DOMAIN_VIRT_KVM; + return type =3D=3D VIR_DOMAIN_VIRT_KVM || + type =3D=3D VIR_DOMAIN_VIRT_HVF; } =20 static bool virQEMUCapsHaveAccel(virQEMUCaps *qemuCaps) { - return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); + return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF); } =20 static const char * @@ -805,6 +808,8 @@ virQEMUCapsAccelStr(virDomainVirtType type) { if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { return "kvm"; + } else if (type =3D=3D VIR_DOMAIN_VIRT_HVF) { + return "hvf"; } else { return "tcg"; } @@ -862,6 +867,8 @@ virQEMUCapsGetAccel(virQEMUCaps *qemuCaps, { if (type =3D=3D VIR_DOMAIN_VIRT_KVM) return &qemuCaps->kvm; + else if (type =3D=3D VIR_DOMAIN_VIRT_HVF) + return &qemuCaps->hvf; =20 return &qemuCaps->tcg; } @@ -992,6 +999,8 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, * take the set of machine types we probed first. */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) accel =3D &qemuCaps->kvm; + else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + accel =3D &qemuCaps->hvf; else accel =3D &qemuCaps->tcg; =20 @@ -2009,6 +2018,7 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) ret->cpuData =3D virCPUDataNewCopy(qemuCaps->cpuData); =20 if (virQEMUCapsAccelCopy(&ret->kvm, &qemuCaps->kvm) < 0 || + virQEMUCapsAccelCopy(&ret->hvf, &qemuCaps->hvf) < 0 || virQEMUCapsAccelCopy(&ret->tcg, &qemuCaps->tcg) < 0) return NULL; =20 @@ -2062,6 +2072,7 @@ void virQEMUCapsDispose(void *obj) virSEVCapabilitiesFree(qemuCaps->sevCapabilities); =20 virQEMUCapsAccelClear(&qemuCaps->kvm); + virQEMUCapsAccelClear(&qemuCaps->hvf); virQEMUCapsAccelClear(&qemuCaps->tcg); } =20 @@ -2313,6 +2324,10 @@ virQEMUCapsIsVirtTypeSupported(virQEMUCaps *qemuCaps, virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG)) return true; =20 + if (virtType =3D=3D VIR_DOMAIN_VIRT_HVF && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + return true; + if (virtType =3D=3D VIR_DOMAIN_VIRT_KVM && virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) return true; @@ -2790,7 +2805,9 @@ bool virQEMUCapsHasMachines(virQEMUCaps *qemuCaps) { =20 - return !!qemuCaps->kvm.nmachineTypes || !!qemuCaps->tcg.nmachineTypes; + return !!qemuCaps->kvm.nmachineTypes || + !!qemuCaps->hvf.nmachineTypes || + !!qemuCaps->tcg.nmachineTypes; } =20 =20 @@ -4718,6 +4735,7 @@ virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) virArchToString(qemuCaps->arch)); =20 virQEMUCapsFormatAccel(qemuCaps, &buf, VIR_DOMAIN_VIRT_KVM); + virQEMUCapsFormatAccel(qemuCaps, &buf, VIR_DOMAIN_VIRT_HVF); virQEMUCapsFormatAccel(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU); =20 for (i =3D 0; i < qemuCaps->ngicCapabilities; i++) { @@ -5577,6 +5595,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->libvirtVersion =3D LIBVIR_VERSION_NUMBER; =20 virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_HVF); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 if (virQEMUCapsHaveAccel(qemuCaps)) { diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index de1146251d..c80c9bae2d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -9288,7 +9288,7 @@ qemuProcessQMPLaunch(qemuProcessQMP *proc) if (proc->forceTCG) machine =3D "none,accel=3Dtcg"; else - machine =3D "none,accel=3Dkvm:tcg"; + machine =3D "none,accel=3Dkvm:hvf:tcg"; =20 VIR_DEBUG("Try to probe capabilities of '%s' via QMP, machine %s", proc->binary, machine); --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 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=1641322503; cv=none; d=zohomail.com; s=zohoarc; b=dWTdihkOlAUdKwFdJlVeCM/kap1FDL4wZBecgv82stcATEa1zQ7adA1sbebqnU8fYhD0693a8xBzm92B28131V8DWO4iLQI3gf1OUnT8zKpL3iJsnhwwux0Bs8Shzv9dXeZsgDFEn9k9BNvGefgMwGzr/uPl5iu1dX/klsS7TI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322503; 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=92eTSlBD9JFP0eRAgOMMiVN9czwn6Nekg2s9Oj+/9Ic=; b=O2oIdYDxVg98zvNy/eZ2bx0sxEEzQKfAfK53WC7DLbPuBePSQ0hLgjW+4teAxe/j284o+FV7xaAqPbQ5jQgFuAeYFSYfv08y6fe8/8XfrYR+sDbPZdJwYVGdrgFt1qqy7+7qne1AzT5aztPMyN54yXfPNwepMDlvLakX5wprSz0= 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 1641322503539800.9886614241735; Tue, 4 Jan 2022 10:55:03 -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-441-UeYJxmywMEmg1KWeNPitHg-1; Tue, 04 Jan 2022 13:54:38 -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 D8E7E802E29; Tue, 4 Jan 2022 18:54:32 +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 A77C093241; Tue, 4 Jan 2022 18:54:32 +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 70A821806D03; Tue, 4 Jan 2022 18:54:32 +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 204IsUTC012980 for ; Tue, 4 Jan 2022 13:54:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id EDAF634D4E; Tue, 4 Jan 2022 18:54:30 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD70B34D41; Tue, 4 Jan 2022 18:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322502; 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=92eTSlBD9JFP0eRAgOMMiVN9czwn6Nekg2s9Oj+/9Ic=; b=BT8rFsmCBui4BO1CGhLfnxP3UEofmnrnHuSLxfEvf52yYNtUP43igCv18f19+c03VAM3Rs ML7JmmHPlavG53BM7zqgb2KcNSNsRCDLTd86xypJhYpmyNeapUDsIkEhamtDQZaxw5igz3 Wwdz47b+QOVxxXmH7tko1du9c7qMIHM= X-MC-Unique: UeYJxmywMEmg1KWeNPitHg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 10/17] fixup! qemu: Fix HVF architecture check Date: Tue, 4 Jan 2022 19:52:49 +0100 Message-Id: <20220104185256.339072-11-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: 1641322505097100001 Content-Type: text/plain; charset="utf-8" Apple Silicon (aarch64) has HVF support, but there is no 32-bit Intel hardware that is HVF-capable. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c2ae87d747..da66cdbb22 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3248,7 +3248,8 @@ virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps) hv_support =3D 0; =20 if (qemuCaps->version >=3D 2012000 && - ARCH_IS_X86(qemuCaps->arch) && + (qemuCaps->arch =3D=3D VIR_ARCH_X86_64 || + qemuCaps->arch =3D=3D VIR_ARCH_AARCH64) && hv_support) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_HVF); } --=20 2.31.1 From nobody Tue Apr 30 20:48:28 2024 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 From nobody Tue Apr 30 20:48:28 2024 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=1641322494; cv=none; d=zohomail.com; s=zohoarc; b=Pg/wKemuR/SI/c4GafHTlSe/BwzwIWfJ6H2wOO/E3ceC2SQqXS/Bwc81jFRudaex9kXJLhddTUAUcXtI66WZixgeaiPeaEONm4P0J0L/4wI8vQrTssh3paLBxKtQuVhoB5NrB1ljCscBYbjG+SbLtauIwy660K0gEIPVnNnv5Nk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641322494; 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=hlk+slglLJFyhGpqCvLzgOrcgaYl6RVRYXmdvaue9PY=; b=c1vQX+fh/VoodYXH4EZvkdiHL613Yc/gntDupgmhSEyFbFVwolMgiviWg5YIr6nRKDSMBQ9XyphgQPv1la7EJFnrHBpO8UsKotKbuaRQ8JQcTuWUvsMrGpK3MnqKLsuONrHrl9QNZn1d2UtPxJnHOND8xf5fzUeL6BRLZPIf+Ck= 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 1641322494123747.2085707030859; Tue, 4 Jan 2022 10:54:54 -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-456-vXginS_mNzGKV1RwvhzVkQ-1; Tue, 04 Jan 2022 13:54:51 -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 AC3DC81EE63; Tue, 4 Jan 2022 18:54:46 +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 52F158E5F3; Tue, 4 Jan 2022 18:54:46 +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 24DDB4A7CA; Tue, 4 Jan 2022 18:54:46 +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 204Isilh013206 for ; Tue, 4 Jan 2022 13:54:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id DEB5934D41; Tue, 4 Jan 2022 18:54:44 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.193.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B310429A0; Tue, 4 Jan 2022 18:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641322493; 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=hlk+slglLJFyhGpqCvLzgOrcgaYl6RVRYXmdvaue9PY=; b=WNakyxit5PavF/4Ayy/a+/dUoXyWmVnKb+zgXdpDA3Hcjxx5Z4ljEa82OmBbPRTxsbEyVj koWh5onOOHR5gmqeOqsVFAfMCT7isPDhpB91VM37aeRGtPkF71PcDej7Wp5jEU/TZ1iDuA hnDdrkFDMHdADXZa0CaVEfKzfa5bR18= X-MC-Unique: vXginS_mNzGKV1RwvhzVkQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 12/17] tests: Add HVF test cases Date: Tue, 4 Jan 2022 19:52:51 +0100 Message-Id: <20220104185256.339072-13-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: 1641322494760100001 Content-Type: text/plain; charset="utf-8" We need to use a hardcoded list of capabilities because we don't yet have proper replies files obtained from QEMU running on actual macOS machines. Signed-off-by: Andrea Bolognani --- .../hvf-aarch64-virt-headless.args | 48 +++++++++ .../hvf-aarch64-virt-headless.xml | 45 +++++++++ .../hvf-x86_64-q35-headless.args | 47 +++++++++ .../hvf-x86_64-q35-headless.xml | 44 +++++++++ tests/qemuxml2argvtest.c | 18 ++++ .../hvf-aarch64-virt-headless.xml | 94 ++++++++++++++++++ .../hvf-x86_64-q35-headless.xml | 97 +++++++++++++++++++ tests/qemuxml2xmltest.c | 18 ++++ 8 files changed, 411 insertions(+) create mode 100644 tests/qemuxml2argvdata/hvf-aarch64-virt-headless.args create mode 100644 tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml create mode 100644 tests/qemuxml2argvdata/hvf-x86_64-q35-headless.args create mode 100644 tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml create mode 100644 tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.xml create mode 100644 tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.xml diff --git a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.args b/tests/= qemuxml2argvdata/hvf-aarch64-virt-headless.args new file mode 100644 index 0000000000..0f1eed66c2 --- /dev/null +++ b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.args @@ -0,0 +1,48 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-test/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dtest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-test= /master-key.aes \ +-machine virt,usb=3Doff,dump-guest-core=3Doff,gic-version=3D2 \ +-accel hvf \ +-drive file=3D/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw,if=3Dpfla= sh,format=3Draw,unit=3D0,readonly=3Don \ +-drive file=3D/var/lib/libvirt/qemu/nvram/test_VARS.fd,if=3Dpflash,format= =3Draw,unit=3D1 \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 1b826c23-8767-47ad-a6b5-c83a88277f71 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-test/monitor.so= ck,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc,driftfix=3Dslew \ +-no-shutdown \ +-boot strict=3Don \ +-device pcie-root-port,port=3D8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,multif= unction=3Don,addr=3D0x1 \ +-device pcie-root-port,port=3D9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device pcie-root-port,port=3D10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 \ +-device pcie-root-port,port=3D11,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr= =3D0x1.0x3 \ +-device pcie-root-port,port=3D12,chassis=3D5,id=3Dpci.5,bus=3Dpcie.0,addr= =3D0x1.0x4 \ +-device pcie-root-port,port=3D13,chassis=3D6,id=3Dpci.6,bus=3Dpcie.0,addr= =3D0x1.0x5 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.2,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/test.qcow2,format=3Dqcow2,if=3Dnone,= id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,bus=3Dpci.3,addr=3D0x0,drive=3Ddrive-virtio-disk0,i= d=3Dvirtio-disk0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:9a:e6:c6= ,bus=3Dpci.1,addr=3D0x0 \ +-chardev pty,id=3Dcharserial0 \ +-serial chardev:charserial0 \ +-chardev socket,id=3Dcharchannel0,path=3D/tmp/channel/domain--1-test/org.q= emu.guest_agent.0,server=3Don,wait=3Doff \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.4,addr=3D0x0 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.5,addr=3D0x0 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml b/tests/q= emuxml2argvdata/hvf-aarch64-virt-headless.xml new file mode 100644 index 0000000000..ef13820e17 --- /dev/null +++ b/tests/qemuxml2argvdata/hvf-aarch64-virt-headless.xml @@ -0,0 +1,45 @@ + + test + 1b826c23-8767-47ad-a6b5-c83a88277f71 + 4194304 + 4194304 + 2 + + hvm + /usr/share/edk2/aarch64/QEMU_= EFI-silent-pflash.raw + /var/lib/libvirt/qemu/nvram/test_VARS.fd + + + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.args b/tests/qe= muxml2argvdata/hvf-x86_64-q35-headless.args new file mode 100644 index 0000000000..b3358e3d59 --- /dev/null +++ b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.args @@ -0,0 +1,47 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-test/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dtest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-test= /master-key.aes \ +-machine q35,usb=3Doff,dump-guest-core=3Doff \ +-accel hvf \ +-m 4096 \ +-realtime mlock=3Doff \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 1b826c23-8767-47ad-a6b5-c83a88277f71 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-test/monitor.so= ck,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc,driftfix=3Dslew \ +-no-hpet \ +-no-shutdown \ +-boot strict=3Don \ +-device pcie-root-port,port=3D8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,multif= unction=3Don,addr=3D0x1 \ +-device pcie-root-port,port=3D9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device pcie-root-port,port=3D10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 \ +-device pcie-root-port,port=3D11,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr= =3D0x1.0x3 \ +-device pcie-root-port,port=3D12,chassis=3D5,id=3Dpci.5,bus=3Dpcie.0,addr= =3D0x1.0x4 \ +-device pcie-root-port,port=3D13,chassis=3D6,id=3Dpci.6,bus=3Dpcie.0,addr= =3D0x1.0x5 \ +-device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.2,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/test.qcow2,format=3Dqcow2,if=3Dnone,= id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,bus=3Dpci.3,addr=3D0x0,drive=3Ddrive-virtio-disk0,i= d=3Dvirtio-disk0,bootindex=3D1 \ +-netdev user,id=3Dhostnet0 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:9a:e6:c6= ,bus=3Dpci.1,addr=3D0x0 \ +-chardev pty,id=3Dcharserial0 \ +-device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev socket,id=3Dcharchannel0,path=3D/tmp/channel/domain--1-test/org.q= emu.guest_agent.0,server=3Don,wait=3Doff \ +-device virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel= 0,id=3Dchannel0,name=3Dorg.qemu.guest_agent.0 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.4,addr=3D0x0 \ +-object rng-random,id=3Dobjrng0,filename=3D/dev/urandom \ +-device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.5,addr=3D0x0 \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml b/tests/qem= uxml2argvdata/hvf-x86_64-q35-headless.xml new file mode 100644 index 0000000000..cad560e9ca --- /dev/null +++ b/tests/qemuxml2argvdata/hvf-x86_64-q35-headless.xml @@ -0,0 +1,44 @@ + + test + 1b826c23-8767-47ad-a6b5-c83a88277f71 + 4194304 + 4194304 + 2 + + hvm + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + /dev/urandom + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6c67b36d5c..57435e770e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3500,6 +3500,24 @@ mymain(void) =20 DO_TEST_CAPS_LATEST("devices-acpi-index"); =20 + DO_TEST("hvf-x86_64-q35-headless", + QEMU_CAPS_HVF, + QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_VIRTIO_NET, + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_VIRTIO_RNG, + QEMU_CAPS_OBJECT_RNG_RANDOM); + DO_TEST("hvf-aarch64-virt-headless", + QEMU_CAPS_HVF, + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_VIRTIO_NET, + QEMU_CAPS_DEVICE_PL011, + QEMU_CAPS_DEVICE_VIRTIO_RNG, + QEMU_CAPS_OBJECT_RNG_RANDOM); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 diff --git a/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.xml b/tests= /qemuxml2xmloutdata/hvf-aarch64-virt-headless.xml new file mode 100644 index 0000000000..b5193a02b4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.xml @@ -0,0 +1,94 @@ + + test + 1b826c23-8767-47ad-a6b5-c83a88277f71 + 4194304 + 4194304 + 2 + + hvm + /usr/share/edk2/aarch64/QEMU_= EFI-silent-pflash.raw + /var/lib/libvirt/qemu/nvram/test_VARS.fd + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-aarch64 + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + +
+ +