From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808963244302.9156797778602; Wed, 21 Nov 2018 06:02:43 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A06DE30A02D7; Wed, 21 Nov 2018 14:02:40 +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 4832B6A526; Wed, 21 Nov 2018 14:02:40 +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 E5CF13F60B; Wed, 21 Nov 2018 14:02:39 +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 wALE2WW4020006 for ; Wed, 21 Nov 2018 09:02:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 44A72272C0; Wed, 21 Nov 2018 14:02:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD30327BB7; Wed, 21 Nov 2018 14:02:20 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8AA83082E62; Wed, 21 Nov 2018 14:02:19 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 3816A4194D; Wed, 21 Nov 2018 14:02:18 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qHrdf0LMJtoc; Wed, 21 Nov 2018 17:02:08 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 9B2D141907; Wed, 21 Nov 2018 17:02:08 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:08 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808928; x=1544623329; bh=HILiks6wv2FJUz5v9CISwiwslRE6Kg97sSV MBpcG/o0=; b=CrjHwuYLleZEI1M0ZRQVlnBeZmX19Zdy/p2H77x4d8u6SNVG9oR jK/7vuvqpWc6XnaluecUm3ew15kuicZbMcKe+QxloT75qVXe3HhN5V9OloYM5PUB inpJZzic23vMbIghbaBg5MVjANNyOx6b0+Jbe80ea8DtxPFcM1M+Gm/0= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:44 +0300 Message-ID: <20181121140159.3751-2-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:20 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 01/16] qemu: Add KVM CPUs into cache only if KVM is present 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:02:42 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) From: Roman Bolshakov virQEMUCapsFormatCache/virQEMUCapsLoadCache adds/reads KVM CPUs to/from capabilities cache regardless of QEMU_CAPS_KVM. That can cause undesired side-effects when KVM CPUs are present in the cache on a platform that doesn't support it, e.g. macOS or Linux without KVM support. Signed-off-by: Daniel P. Berrang=C3=A9 Signed-off-by: Roman Bolshakov --- src/qemu/qemu_capabilities.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fde27010e4..4ba8369e3a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3467,11 +3467,13 @@ virQEMUCapsLoadCache(virArch hostArch, } VIR_FREE(str); =20 - if (virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_KV= M) < 0 || + if ((virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && + virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_K= VM) < 0) || virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_QE= MU) < 0) goto cleanup; =20 - if (virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_KVM) < 0 = || + if ((virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && + virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_KVM) < 0= ) || virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_QEMU) < 0) goto cleanup; =20 @@ -3584,7 +3586,8 @@ virQEMUCapsLoadCache(virArch hostArch, if (virQEMUCapsParseSEVInfo(qemuCaps, ctxt) < 0) goto cleanup; =20 - virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 ret =3D 0; @@ -3766,10 +3769,12 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) virBufferAsprintf(&buf, "%s\n", virArchToString(qemuCaps->arch)); =20 - virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_KV= M); virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU= ); =20 - virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_KVM); virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU); =20 for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { @@ -4566,7 +4571,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->libvirtCtime =3D virGetSelfLastChanged(); qemuCaps->libvirtVersion =3D LIBVIR_VERSION_NUMBER; =20 - virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808944962186.3554014804971; Wed, 21 Nov 2018 06:02:24 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AAE743082142; Wed, 21 Nov 2018 14:02: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 700BC101963F; Wed, 21 Nov 2018 14:02:21 +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 B2BDC3F774; Wed, 21 Nov 2018 14:02:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2I0v019965 for ; Wed, 21 Nov 2018 09:02:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id A93665D6A9; Wed, 21 Nov 2018 14:02:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A20955D760 for ; Wed, 21 Nov 2018 14:02:18 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B0D6356FD for ; Wed, 21 Nov 2018 14:02:17 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 093C04194B for ; Wed, 21 Nov 2018 14:02:16 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WzfiiAwcsWKF for ; Wed, 21 Nov 2018 17:02:10 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 4934F41931 for ; Wed, 21 Nov 2018 17:02:10 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:09 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808930; x=1544623331; bh=WmLpiS+P549PmHpVAF2oEyjdIO7YkSaWdol mMl3l/P0=; b=bDKPp0TkcOCu7Ovk4TyRpeTpXuxpK4XuHeN7xQ0C9fAkhbifTHA JmEiV4rJr2Aw+NqtxUBCssG7npbwTvIouipeaXAoGEyTzCLuPe8xdHSQi00HzUVP VpiwDmj5VtZpcBG8mRC1etPvjSIBCP9rphXBf79hFLYRLVjoCTkDTdvs= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:45 +0300 Message-ID: <20181121140159.3751-3-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 14:02:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 14:02:17 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 02/16] conf: Add hvf domain type 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 21 Nov 2018 14:02:22 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- docs/formatdomain.html.in | 8 ++++---- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 4 +++- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2af4960981..25dd4bbbd6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -22,10 +22,10 @@ type specifies the hypervisor used for running the domain. The allowed values are driver specific, but - include "xen", "kvm", "qemu", "lxc" and "kqemu". The - second attribute is id which is a unique - integer identifier for the running guest machine. Inactive - machines have no id value. + include "xen", "kvm", "hvf" (since 4.10.0 and = QEMU + 2.12), "qemu", "lxc" and "kqemu". The second attribute is + id which is a unique integer identifier for the running + guest machine. Inactive machines have no id value.

=20 =20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 5ee727eefa..596e347eda 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -213,6 +213,7 @@ phyp vz bhyve + hvf diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 13874837c2..369d4bd634 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -119,7 +119,8 @@ VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST, "phyp", "parallels", "bhyve", - "vz") + "vz", + "hvf") =20 VIR_ENUM_IMPL(virDomainOS, VIR_DOMAIN_OSTYPE_LAST, "hvm", @@ -15024,6 +15025,7 @@ virDomainVideoDefaultType(const virDomainDef *def) case VIR_DOMAIN_VIRT_HYPERV: case VIR_DOMAIN_VIRT_PHYP: case VIR_DOMAIN_VIRT_NONE: + case VIR_DOMAIN_VIRT_HVF: case VIR_DOMAIN_VIRT_LAST: default: return VIR_DOMAIN_VIDEO_TYPE_DEFAULT; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 467785cd83..65f00692b7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -245,6 +245,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 23a6661c10..0fb796e15c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7251,6 +7251,10 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAddLit(&buf, ",accel=3Dkvm"); break; =20 + case VIR_DOMAIN_VIRT_HVF: + virBufferAddLit(&buf, ",accel=3Dhvf"); + break; + case VIR_DOMAIN_VIRT_KQEMU: case VIR_DOMAIN_VIRT_XEN: case VIR_DOMAIN_VIRT_LXC: --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808973992856.3265025515872; Wed, 21 Nov 2018 06:02:53 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 48B8730C318F; Wed, 21 Nov 2018 14:02:52 +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 0E8345D73F; Wed, 21 Nov 2018 14:02:52 +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 B02AB3F615; Wed, 21 Nov 2018 14:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2hC9020051 for ; Wed, 21 Nov 2018 09:02:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4FC18649A2; Wed, 21 Nov 2018 14:02:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3391C649C5 for ; Wed, 21 Nov 2018 14:02:26 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B84F799C1C for ; Wed, 21 Nov 2018 14:02:20 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 51DA14194B for ; Wed, 21 Nov 2018 14:02:19 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XFRAYe_pQctr for ; Wed, 21 Nov 2018 17:02:17 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id AA4444193F for ; Wed, 21 Nov 2018 17:02:11 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808937; x=1544623338; bh=PBaB2ZA9wIg7HQIcuaEAtk9xRlE+/v6LL7z 8dB09x/g=; b=tPokGp5BraeoVW8hgtE2SQ4N8K8c15MpgodnwFKqkVkY8Q3WrQt 0P5efJZMqOC2l7ho20vrgfYeDIm5c7iyFQe7/CFnpBbZ0YPcFHAyZe4rsTkqTUpA pLSbLk8JS6/4IMC+vtY6moAkN3lNoCJXZOKbv8CtsxbqdpwP9xCo8XCE= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:46 +0300 Message-ID: <20181121140159.3751-4-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 14:02:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 14:02:21 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 03/16] qemu: Define hvf capability 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Nov 2018 14:02:53 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Roman Bolshakov --- 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 4ba8369e3a..0bbda80782 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -515,6 +515,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 320 */ "memory-backend-memfd.hugetlb", "iothread.poll-max-ns", + "hvf", ); =20 =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c2caaf6fe1..7d08e8d243 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -499,6 +499,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 320 */ QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB, /* -object memory-backend-memfd= .hugetlb */ QEMU_CAPS_IOTHREAD_POLLING, /* -object iothread.poll-max-ns */ + QEMU_CAPS_HVF, /* Whether Hypervisor.framework is available */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808961214123.20220180646243; Wed, 21 Nov 2018 06:02:41 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD20930833A5; Wed, 21 Nov 2018 14:02:38 +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 5CD501054FD6; Wed, 21 Nov 2018 14:02:38 +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 0CF74181B9E7; Wed, 21 Nov 2018 14:02:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2Wgv020001 for ; Wed, 21 Nov 2018 09:02:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1C8BE1054FCF; Wed, 21 Nov 2018 14:02:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 10F301054FC9 for ; Wed, 21 Nov 2018 14:02:26 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 495F5307EABE for ; Wed, 21 Nov 2018 14:02:25 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id D6DB241953 for ; Wed, 21 Nov 2018 14:02:23 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9ojniIQf0RN0 for ; Wed, 21 Nov 2018 17:02:18 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id B325241925 for ; Wed, 21 Nov 2018 17:02:12 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808938; x=1544623339; bh=spgFUXO4Z7xN97+UPqjWcCBHpz70PAK6p4S m/Rg0ep0=; b=WSxil4SC7qVNu13X8kQxqeHsd1o7K9/GU3s1BQaTl7Wtxku5Zji xQiZHPga/5mnDZPUVHb2tUksu790Huiyse7opjmSeA+ZlpmS080ewSiRjIR2sC6P IXwS264GrKDTBccNk/1g6UGk0P7g9yUAf4dFZ1k6RSLdvZWF83DR6lpI= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:47 +0300 Message-ID: <20181121140159.3751-5-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 14:02:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 14:02:25 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 04/16] qemu: Query hvf capability on macOS 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 14:02:40 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" There's no QMP command for querying if hvf is supported, therefore we use sysctl interface that tells if Hypervisor.framwork works/available on the host. Signed-off-by: Roman Bolshakov --- src/qemu/qemu_capabilities.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0bbda80782..5ebe3f1afe 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -54,6 +54,10 @@ #include #include #include +#ifdef __APPLE__ +# include +# include +#endif =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 @@ -2599,6 +2603,33 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps, return 0; } =20 +#ifdef __APPLE__ +static int +virQEMUCapsProbeHVF(virQEMUCapsPtr qemuCaps) +{ + int hv_support; + size_t len =3D sizeof(hv_support); + if (sysctlbyname("kern.hv_support", &hv_support, &len, NULL, 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(virQEMUCapsPtr qemuCaps) +{ + (void) qemuCaps; + + return 0; +} +#endif + struct virQEMUCapsCommandLineProps { const char *option; const char *param; @@ -4150,6 +4181,9 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (virQEMUCapsProbeQMPKVMState(qemuCaps, mon) < 0) goto cleanup; =20 + if (virQEMUCapsProbeHVF(qemuCaps) < 0) + goto cleanup; + if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0) goto cleanup; if (virQEMUCapsProbeQMPDevices(qemuCaps, mon) < 0) --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808958515572.2338538255182; Wed, 21 Nov 2018 06:02:38 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 2A6F83154848; Wed, 21 Nov 2018 14:02:36 +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 D6D3D6608F; Wed, 21 Nov 2018 14:02:35 +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 76C2F3F609; Wed, 21 Nov 2018 14:02:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2R1R019976 for ; Wed, 21 Nov 2018 09:02:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D7875C23A; Wed, 21 Nov 2018 14:02:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63F885C22E for ; Wed, 21 Nov 2018 14:02:27 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C73B31256A6 for ; Wed, 21 Nov 2018 14:02:26 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 0EC9941954 for ; Wed, 21 Nov 2018 14:02:25 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M3Fvi6eIVxXc for ; Wed, 21 Nov 2018 17:02:19 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 13B3D41947 for ; Wed, 21 Nov 2018 17:02:14 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:13 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808939; x=1544623340; bh=TnaoiEdLUrHKcwm6/hL89u/bB6ebrhVyec1 9JBmqpSM=; b=gFDxTkxQS941GhpzDdPDC044+1IxAx74bHqhLpyxjDGWAyp3WEl Fof4amzi97+P4KtlLV/OqK3FS1SnVEWfUQUPYbAu/BXA0rYF8xTN+Hiav5dOVw4x etJ3JAp3KuRNAYLKvpAtdwbhO8KdIJ9O1PFmv9Pkgrs7vaDzy6An9DAs= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:48 +0300 Message-ID: <20181121140159.3751-6-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:26 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 05/16] qemu: Expose hvf domain type if hvf is supported 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 21 Nov 2018 14:02:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5ebe3f1afe..645ce2c89e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -859,6 +859,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, } } =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) { + if (virCapabilitiesAddGuestDomain(guest, + VIR_DOMAIN_VIRT_HVF, + NULL, + NULL, + 0, + NULL) =3D=3D NULL) { + goto cleanup; + } + } + if ((ARCH_IS_X86(guestarch) || guestarch =3D=3D VIR_ARCH_AARCH64) && virCapabilitiesAddGuestFeature(guest, "acpi", true, true) =3D=3D N= ULL) { goto cleanup; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808970216710.7181893047414; Wed, 21 Nov 2018 06:02:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4366730DDBCF; Wed, 21 Nov 2018 14:02:48 +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 039555C22E; Wed, 21 Nov 2018 14:02:48 +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 B19FC3F612; Wed, 21 Nov 2018 14:02:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2hct020050 for ; Wed, 21 Nov 2018 09:02:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4B0FE6443B; Wed, 21 Nov 2018 14:02:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33AB58387E for ; Wed, 21 Nov 2018 14:02:31 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4445EA08F8 for ; Wed, 21 Nov 2018 14:02:30 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CD8F94194B for ; Wed, 21 Nov 2018 14:02:28 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iR57bmEuQort for ; Wed, 21 Nov 2018 17:02:23 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 2A53641949 for ; Wed, 21 Nov 2018 17:02:15 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:14 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808943; x=1544623344; bh=TIiUgQJnhwDthsNpTKhsFkm4u7rPxWpL15r RuONCt9E=; b=HuA/uioRqyrrSMT6kW0q6exoK+a4QTD8BzVLJm0DBSkInTvzbQB NLYv/LaDwSMPn4nUQyqkfZXzX3K3n426n/POuwbhbi60K8YRv3+8e6UyvzxyLapt 2VQDF3VY/d42bh8oU+lDIzvKaiuOdKaBX9hneOaIPk1bnjemnStGfZwE= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:49 +0300 Message-ID: <20181121140159.3751-7-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 14:02:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 14:02:30 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 06/16] qemu: Rename kvmCPU to accelCPU 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 21 Nov 2018 14:02:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" QEMU supports a number of accelerators. It'd be good to have more generic name for kvmCPUModels and kvmCPU. Signed-off-by: Roman Bolshakov --- src/qemu/qemu_capabilities.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 645ce2c89e..ad15d2853e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -578,7 +578,7 @@ struct _virQEMUCaps { =20 virArch arch; =20 - virDomainCapsCPUModelsPtr kvmCPUModels; + virDomainCapsCPUModelsPtr accelCPUModels; virDomainCapsCPUModelsPtr tcgCPUModels; =20 size_t nmachineTypes; @@ -589,7 +589,7 @@ struct _virQEMUCaps { =20 virSEVCapability *sevCapabilities; =20 - virQEMUCapsHostCPUData kvmCPU; + virQEMUCapsHostCPUData accelCPU; virQEMUCapsHostCPUData tcgCPU; }; =20 @@ -1564,9 +1564,9 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) =20 ret->arch =3D qemuCaps->arch; =20 - if (qemuCaps->kvmCPUModels) { - ret->kvmCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->kvmCPUM= odels); - if (!ret->kvmCPUModels) + if (qemuCaps->accelCPUModels) { + ret->accelCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->accel= CPUModels); + if (!ret->accelCPUModels) goto error; } =20 @@ -1576,7 +1576,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) goto error; } =20 - if (virQEMUCapsHostCPUDataCopy(&ret->kvmCPU, &qemuCaps->kvmCPU) < 0 || + if (virQEMUCapsHostCPUDataCopy(&ret->accelCPU, &qemuCaps->accelCPU) < = 0 || virQEMUCapsHostCPUDataCopy(&ret->tcgCPU, &qemuCaps->tcgCPU) < 0) goto error; =20 @@ -1623,7 +1623,7 @@ void virQEMUCapsDispose(void *obj) } VIR_FREE(qemuCaps->machineTypes); =20 - virObjectUnref(qemuCaps->kvmCPUModels); + virObjectUnref(qemuCaps->accelCPUModels); virObjectUnref(qemuCaps->tcgCPUModels); =20 virBitmapFree(qemuCaps->flags); @@ -1636,7 +1636,7 @@ void virQEMUCapsDispose(void *obj) =20 virSEVCapabilitiesFree(qemuCaps->sevCapabilities); =20 - virQEMUCapsHostCPUDataClear(&qemuCaps->kvmCPU); + virQEMUCapsHostCPUDataClear(&qemuCaps->accelCPU); virQEMUCapsHostCPUDataClear(&qemuCaps->tcgCPU); } =20 @@ -1794,8 +1794,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, size_t i; virDomainCapsCPUModelsPtr cpus =3D NULL; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM && qemuCaps->kvmCPUModels) - cpus =3D qemuCaps->kvmCPUModels; + if (type =3D=3D VIR_DOMAIN_VIRT_KVM && qemuCaps->accelCPUModels) + cpus =3D qemuCaps->accelCPUModels; else if (type =3D=3D VIR_DOMAIN_VIRT_QEMU && qemuCaps->tcgCPUModels) cpus =3D qemuCaps->tcgCPUModels; =20 @@ -1804,7 +1804,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, return -1; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; + qemuCaps->accelCPUModels =3D cpus; else qemuCaps->tcgCPUModels =3D cpus; } @@ -1823,7 +1823,7 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - return qemuCaps->kvmCPUModels; + return qemuCaps->accelCPUModels; else return qemuCaps->tcgCPUModels; } @@ -1834,7 +1834,7 @@ virQEMUCapsGetHostCPUData(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - return &qemuCaps->kvmCPU; + return &qemuCaps->accelCPU; else return &qemuCaps->tcgCPU; } @@ -1898,7 +1898,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, =20 case VIR_CPU_MODE_CUSTOM: if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; + cpus =3D qemuCaps->accelCPUModels; else cpus =3D qemuCaps->tcgCPUModels; return cpus && cpus->nmodels > 0; @@ -2385,7 +2385,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) qemuCaps->tcgCPUModels =3D models; else - qemuCaps->kvmCPUModels =3D models; + qemuCaps->accelCPUModels =3D models; =20 return 0; } @@ -3232,7 +3232,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, goto cleanup; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; + qemuCaps->accelCPUModels =3D cpus; else qemuCaps->tcgCPUModels =3D cpus; =20 @@ -3710,7 +3710,7 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { typeStr =3D "kvm"; - cpus =3D qemuCaps->kvmCPUModels; + cpus =3D qemuCaps->accelCPUModels; } else { typeStr =3D "tcg"; cpus =3D qemuCaps->tcgCPUModels; @@ -5107,7 +5107,7 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, virDomainCapsCPUModelsPtr cpus; =20 if (domCaps->virttype =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; + cpus =3D qemuCaps->accelCPUModels; else cpus =3D qemuCaps->tcgCPUModels; =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808955405999.4279412974795; Wed, 21 Nov 2018 06:02:35 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 390E32D800; Wed, 21 Nov 2018 14:02:33 +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 E238053C27; Wed, 21 Nov 2018 14:02: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 8000F3F606; Wed, 21 Nov 2018 14:02:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2T2s019990 for ; Wed, 21 Nov 2018 09:02:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id EAF444DA7C; Wed, 21 Nov 2018 14:02:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E18CB5C265 for ; Wed, 21 Nov 2018 14:02:29 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DC033082139 for ; Wed, 21 Nov 2018 14:02:27 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 1D0E841947 for ; Wed, 21 Nov 2018 14:02:26 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4nydMTlCp_Ql for ; Wed, 21 Nov 2018 17:02:25 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 48BF041931 for ; Wed, 21 Nov 2018 17:02:16 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808945; x=1544623346; bh=1R5U40A9w4yGl7bzOs6/Twzk2zEtZDFwpd4 XCSFi5Og=; b=Yb93LS4j5HLRik6ldjlRZZdujgwHPDgXL6VXnPCdsKd+HVcvASK aGXE9oJD9hW7qgmcCnBeFSKn3tjuA9LETkTPNS7rZkADsyxqtuzyq9omNU05ukFJ 1ufZNA5GJ9xmTYbScg/jrVDVXPOXEy5FAIk1+R+RXqYSe69mIO63M/ao= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:50 +0300 Message-ID: <20181121140159.3751-8-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 21 Nov 2018 14:02:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 21 Nov 2018 14:02:27 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 07/16] qemu: Introduce virQEMUCapsTypeIsAccelerated 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 14:02:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- src/qemu/qemu_capabilities.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ad15d2853e..e302fbb48f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -637,6 +637,11 @@ static const char *virQEMUCapsArchToString(virArch arc= h) 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. */ @@ -1794,7 +1799,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, size_t i; virDomainCapsCPUModelsPtr cpus =3D NULL; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM && qemuCaps->accelCPUModels) + if (virQEMUCapsTypeIsAccelerated(type) && qemuCaps->accelCPUModels) cpus =3D qemuCaps->accelCPUModels; else if (type =3D=3D VIR_DOMAIN_VIRT_QEMU && qemuCaps->tcgCPUModels) cpus =3D qemuCaps->tcgCPUModels; @@ -1803,7 +1808,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, if (!(cpus =3D virDomainCapsCPUModelsNew(count))) return -1; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(type)) qemuCaps->accelCPUModels =3D cpus; else qemuCaps->tcgCPUModels =3D cpus; @@ -1822,7 +1827,7 @@ virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(type)) return qemuCaps->accelCPUModels; else return qemuCaps->tcgCPUModels; @@ -1833,7 +1838,7 @@ static virQEMUCapsHostCPUDataPtr virQEMUCapsGetHostCPUData(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(type)) return &qemuCaps->accelCPU; else return &qemuCaps->tcgCPU; @@ -1889,7 +1894,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, =20 switch (mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: - return type =3D=3D VIR_DOMAIN_VIRT_KVM && + return virQEMUCapsTypeIsAccelerated(type) && virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch); =20 case VIR_CPU_MODE_HOST_MODEL: @@ -1897,7 +1902,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, VIR_QEMU_CAPS_HOST_CPU_REPORTED); =20 case VIR_CPU_MODE_CUSTOM: - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(type)) cpus =3D qemuCaps->accelCPUModels; else cpus =3D qemuCaps->tcgCPUModels; @@ -3004,7 +3009,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr 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 virCPUGetHost(qemuCaps->arch, VIR_CPU_TYPE_GUEST, NULL, NULL))) @@ -3231,7 +3236,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (!(cpus =3D virDomainCapsCPUModelsNew(n))) goto cleanup; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(type)) qemuCaps->accelCPUModels =3D cpus; else qemuCaps->tcgCPUModels =3D cpus; @@ -3708,7 +3713,7 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, const char *typeStr; size_t i; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { + if (virQEMUCapsTypeIsAccelerated(type)) { typeStr =3D "kvm"; cpus =3D qemuCaps->accelCPUModels; } else { @@ -4966,7 +4971,8 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr 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) && + !virQEMUCapsTypeIsAccelerated(capsType)) { virReportError(VIR_ERR_INVALID_ARG, _("KVM is not supported by '%s' on this host"), binary); @@ -5106,7 +5112,7 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, if (virCPUGetModels(domCaps->arch, &models) >=3D 0) { virDomainCapsCPUModelsPtr cpus; =20 - if (domCaps->virttype =3D=3D VIR_DOMAIN_VIRT_KVM) + if (virQEMUCapsTypeIsAccelerated(domCaps->virttype)) cpus =3D qemuCaps->accelCPUModels; else cpus =3D qemuCaps->tcgCPUModels; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808958385574.4211170815718; Wed, 21 Nov 2018 06:02:38 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 2942D96DB; Wed, 21 Nov 2018 14:02:36 +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 D41618387C; Wed, 21 Nov 2018 14:02:35 +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 7688B181B9E7; Wed, 21 Nov 2018 14:02:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2Xgw020012 for ; Wed, 21 Nov 2018 09:02:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 49BFF1054FCF; Wed, 21 Nov 2018 14:02:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 422DA1054FC9 for ; Wed, 21 Nov 2018 14:02:33 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DE6430024EA for ; Wed, 21 Nov 2018 14:02:32 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id D93AA41947 for ; Wed, 21 Nov 2018 14:02:30 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qe8TjTDuJWPB for ; Wed, 21 Nov 2018 17:02:26 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 8799F4193A for ; Wed, 21 Nov 2018 17:02:17 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:17 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808946; x=1544623347; bh=WOSHGQ/YOCEFAHCBaDaJBGdx3Ct/cWJ0VMm 59y0pEKc=; b=EcmRTwIwL6yBr0eCUjWSbCY/W6vjY9cfPqU6yQdMg8n2LDyZKM2 Oug7FccW13QvNSy/VI1mNoQpxoOk72Iw5CvPVx9RuAFSitAkYtPs2qG9vAWuVM2z UAeb611kIIVMp/tCToz0Y/NyG5EdDapyXOaurM78C8srTJ3WfTDsPG0E= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:51 +0300 Message-ID: <20181121140159.3751-9-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:02:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:02:32 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 08/16] qemu: Introduce virQEMUCapsHaveAccel 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 21 Nov 2018 14:02:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- src/qemu/qemu_capabilities.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e302fbb48f..f80ee62019 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -643,6 +643,12 @@ virQEMUCapsTypeIsAccelerated(virDomainVirtType type) return type =3D=3D VIR_DOMAIN_VIRT_KVM; } =20 +static bool +virQEMUCapsHaveAccel(virQEMUCapsPtr qemuCaps) +{ + return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); +} + /* Checks whether a domain with @guest arch can run natively on @host. */ bool @@ -2387,7 +2393,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, if (!(models =3D virQEMUCapsFetchCPUDefinitions(mon))) return -1; =20 - if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + if (tcg || !virQEMUCapsHaveAccel(qemuCaps)) qemuCaps->tcgCPUModels =3D models; else qemuCaps->accelCPUModels =3D models; @@ -2413,7 +2419,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) return 0; =20 - if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { + if (tcg || !virQEMUCapsHaveAccel(qemuCaps)) { virtType =3D VIR_DOMAIN_VIRT_QEMU; model =3D "max"; } else { @@ -4528,7 +4534,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, if (virQEMUCapsInitQMPMonitor(qemuCaps, cmd->mon) < 0) goto cleanup; =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { + if (virQEMUCapsHaveAccel(qemuCaps)) { virQEMUCapsInitQMPCommandAbort(cmd); if ((rc =3D virQEMUCapsInitQMPCommandRun(cmd, true)) !=3D 0) { if (rc =3D=3D 1) --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808967336632.7050158218742; Wed, 21 Nov 2018 06:02:47 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id ED94F307D85F; Wed, 21 Nov 2018 14:02:44 +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 B13385D73F; Wed, 21 Nov 2018 14:02:44 +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 51167181B9F6; Wed, 21 Nov 2018 14:02:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2eaF020031 for ; Wed, 21 Nov 2018 09:02:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6AB0882719; Wed, 21 Nov 2018 14:02:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53C6070132 for ; Wed, 21 Nov 2018 14:02:36 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F21AA0BF0 for ; Wed, 21 Nov 2018 14:02:35 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 9A35E41947 for ; Wed, 21 Nov 2018 14:02:33 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1eWmIDwd3hbM for ; Wed, 21 Nov 2018 17:02:28 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 805D441907 for ; Wed, 21 Nov 2018 17:02:18 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:18 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808948; x=1544623349; bh=Ty5wLMVkmIqB0cmk0KOzVBz/vPzsyrtRyOd xVHDipRc=; b=Y77trsI+skjnrs2/JdSZUm7bB3K6dEUv36t5YgKyRAjVixbRCSe E3vXD/W6LlGHZU/tfG2G+YoryYxZ33ZUtwLekvqvicMc7DhsJ3su1SvJ9zV7KICU E/YO8Twq/un5YsRznvu0SwGW0DSYVWgRTvQ7b6iav0YqgyEAWjIOwOD8= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:52 +0300 Message-ID: <20181121140159.3751-10-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 14:02:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 14:02:35 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 09/16] qemu: Introduce virQEMUCapsToVirtType 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Nov 2018 14:02:46 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The function is needed to support multiple accelerators without cluttering codebase by conditionals. At the first glance that might cause an issue related to the ordering capabilities being checked on a system with many accelerators but in the current code base it should be just fine because virQEMUCapsGetHostCPUData is not interested in the exact type of accelarator. Signed-off-by: Roman Bolshakov --- src/qemu/qemu_capabilities.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f80ee62019..1c6b79594d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -649,6 +649,15 @@ virQEMUCapsHaveAccel(virQEMUCapsPtr qemuCaps) return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); } =20 +static virDomainVirtType +virQEMUCapsToVirtType(virQEMUCapsPtr qemuCaps) +{ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + return VIR_DOMAIN_VIRT_KVM; + else + return VIR_DOMAIN_VIRT_QEMU; +} + /* Checks whether a domain with @guest arch can run natively on @host. */ bool @@ -2423,7 +2432,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, virtType =3D VIR_DOMAIN_VIRT_QEMU; model =3D "max"; } else { - virtType =3D VIR_DOMAIN_VIRT_KVM; + virtType =3D virQEMUCapsToVirtType(qemuCaps); model =3D "host"; } =20 @@ -4969,10 +4978,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, machine =3D virQEMUCapsGetPreferredMachine(qemuCaps); } =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - capsType =3D VIR_DOMAIN_VIRT_KVM; - else - capsType =3D VIR_DOMAIN_VIRT_QEMU; + capsType =3D virQEMUCapsToVirtType(qemuCaps); =20 if (virttype =3D=3D VIR_DOMAIN_VIRT_NONE) virttype =3D capsType; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808996325973.9556971651696; Wed, 21 Nov 2018 06:03:16 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4650030A8190; Wed, 21 Nov 2018 14:03:14 +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 EEE1E101963F; Wed, 21 Nov 2018 14:03:13 +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 9E02A3F60C; Wed, 21 Nov 2018 14:03:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE3CPC020237 for ; Wed, 21 Nov 2018 09:03:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6E8035B6BA; Wed, 21 Nov 2018 14:03:12 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4312817C30 for ; Wed, 21 Nov 2018 14:02:43 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9A353001569 for ; Wed, 21 Nov 2018 14:02:41 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 6611C4194D for ; Wed, 21 Nov 2018 14:02:40 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LGy2KZZEN_lc for ; Wed, 21 Nov 2018 17:02:30 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 7D49D4193F for ; Wed, 21 Nov 2018 17:02:19 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808950; x=1544623351; bh=jPSzQLv/QKQfLmGJdg7KGO2QiFtNZZOFqvI 76xoPkXk=; b=P6KmkLP6e0RLZeSh4wzDrAj8YMAjgU8U8ph0p2llU7YSaGIRkY/ cVWOU9opDh2dnzXw+jFPvBeAII9NEr3UQpOi3FGRt0z7tqWHsQCNxG5kK8CGRCtn eRRrLug2coErKA/pJ75wL1jFAVfrtPj5QRCu2P7hKwwNx3LbPH1O4tDU= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:53 +0300 Message-ID: <20181121140159.3751-11-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 21 Nov 2018 14:02:42 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 10/16] qemu: Introduce virQEMUCapsAccelStr 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 14:03:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This makes possible to add more accelerators by touching less code and reduces code duplication. Signed-off-by: Roman Bolshakov --- src/qemu/qemu_capabilities.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 1c6b79594d..1cee9a833b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -658,6 +658,16 @@ virQEMUCapsToVirtType(virQEMUCapsPtr qemuCaps) return VIR_DOMAIN_VIRT_QEMU; } =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 @@ -3670,7 +3680,7 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsPtr qemu= Caps, { virQEMUCapsHostCPUDataPtr cpuData =3D virQEMUCapsGetHostCPUData(qemuCa= ps, type); qemuMonitorCPUModelInfoPtr model =3D cpuData->info; - const char *typeStr =3D type =3D=3D VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg= "; + const char *typeStr =3D virQEMUCapsAccelStr(type); size_t i; =20 if (!model) @@ -3725,16 +3735,13 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { virDomainCapsCPUModelsPtr cpus; - const char *typeStr; + const char *typeStr =3D virQEMUCapsAccelStr(type); size_t i; =20 - if (virQEMUCapsTypeIsAccelerated(type)) { - typeStr =3D "kvm"; + if (virQEMUCapsTypeIsAccelerated(type)) cpus =3D qemuCaps->accelCPUModels; - } else { - typeStr =3D "tcg"; + else cpus =3D qemuCaps->tcgCPUModels; - } =20 if (!cpus) return; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808987472704.4783015890405; Wed, 21 Nov 2018 06:03:07 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E3BAA4058; Wed, 21 Nov 2018 14:03:05 +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 44379277B3; Wed, 21 Nov 2018 14:03:05 +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 D3528181BA17; Wed, 21 Nov 2018 14:03:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2xLW020124 for ; Wed, 21 Nov 2018 09:02:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 46A676B8E1; Wed, 21 Nov 2018 14:02:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D55856B8DB for ; Wed, 21 Nov 2018 14:02:40 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C443A356F1 for ; Wed, 21 Nov 2018 14:02:39 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 57A9041907 for ; Wed, 21 Nov 2018 14:02:38 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zRD9W7-yO5WQ for ; Wed, 21 Nov 2018 17:02:33 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 8798B4194E for ; Wed, 21 Nov 2018 17:02:20 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:20 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808953; x=1544623354; bh=7OdNnBvdaiyXLslmjbqTsDQ8N+NB4Dvelks wcs8wggA=; b=YJrSfbsXwdh8ZSD+owcJfNfLh5WOWnao0p4okZrCUmtaeaLG6tV WNsdsuNnWxFGjlcRrCzPHj0tzWRhW/bFQYvRyX4oOJbJwct/gQHoJHo9lRpDAqec FSXcdlpGKcT2vdZd2SdAsUZdpAWi1MUu8bGuAk+iwItsK+qVzzIdMqKM= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:54 +0300 Message-ID: <20181121140159.3751-12-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 14:02:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 14:02:40 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 11/16] qemu: Make error message accel-agnostic 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 14:03:06 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" With more acceleration types, KVM should be used only in error messages related to KVM. Signed-off-by: Roman Bolshakov --- 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 1cee9a833b..8a1fb2b5d9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4993,8 +4993,8 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, if (virQEMUCapsTypeIsAccelerated(virttype) && !virQEMUCapsTypeIsAccelerated(capsType)) { 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); goto cleanup; } =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808966627769.8346360356403; Wed, 21 Nov 2018 06:02:46 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 14035307D84C; Wed, 21 Nov 2018 14:02:44 +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 CB02D66083; Wed, 21 Nov 2018 14:02:43 +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 5CC543F60F; Wed, 21 Nov 2018 14:02:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE2gRR020045 for ; Wed, 21 Nov 2018 09:02:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id B4FEF8230C; Wed, 21 Nov 2018 14:02:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB36470132 for ; Wed, 21 Nov 2018 14:02:42 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4DC613AA7 for ; Wed, 21 Nov 2018 14:02:40 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 6474F41947 for ; Wed, 21 Nov 2018 14:02:39 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rFvDSV1jSW5S for ; Wed, 21 Nov 2018 17:02:38 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 9CC244194D for ; Wed, 21 Nov 2018 17:02:21 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:21 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808958; x=1544623359; bh=hYqOraXluvJKBkqnewge0Lx/+fySJJ3ONKG LRRUcJIQ=; b=hTF12BIUJ8WgW0+EgCCcgne7EoI5HgJTZv0sPNUBnqGn5FyEi/A QUu/MVukCyrQDWXKihlGMqkn0FwTT+0fAVRr1thMudsSZEfGCXunazQxPeQdBzOk W0P7imA1/clEZZna0JEPdI9oDlHD62s4A6e5ikgQVr3zZIUw6lFj0AK0= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:55 +0300 Message-ID: <20181121140159.3751-13-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 21 Nov 2018 14:02:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 21 Nov 2018 14:02:41 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 12/16] qemu: Correct CPU capabilities probing for hvf 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Nov 2018 14:02:45 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) With this change virsh domcapabilites shows: Signed-off-by: Roman Bolshakov Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8a1fb2b5d9..4297a11b27 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -640,13 +640,15 @@ static const char *virQEMUCapsArchToString(virArch ar= ch) 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(virQEMUCapsPtr qemuCaps) { - return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM); + return virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF); } =20 static virDomainVirtType @@ -654,6 +656,8 @@ virQEMUCapsToVirtType(virQEMUCapsPtr qemuCaps) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) return VIR_DOMAIN_VIRT_KVM; + else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + return VIR_DOMAIN_VIRT_HVF; else return VIR_DOMAIN_VIRT_QEMU; } @@ -663,6 +667,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"; } @@ -3109,6 +3115,8 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCa= ps, =20 if (virtType =3D=3D VIR_DOMAIN_VIRT_KVM) hostCPUNode =3D virXPathNode("./hostCPU[@type=3D'kvm']", ctxt); + else if (virtType =3D=3D VIR_DOMAIN_VIRT_HVF) + hostCPUNode =3D virXPathNode("./hostCPU[@type=3D'hvf']", ctxt); else hostCPUNode =3D virXPathNode("./hostCPU[@type=3D'tcg']", ctxt); =20 @@ -3244,6 +3252,8 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) n =3D virXPathNodeSet("./cpu[@type=3D'kvm']", ctxt, &nodes); + else if (type =3D=3D VIR_DOMAIN_VIRT_HVF) + n =3D virXPathNodeSet("./cpu[@type=3D'hvf']", ctxt, &nodes); else n =3D virXPathNodeSet("./cpu[@type=3D'tcg']", ctxt, &nodes); =20 @@ -3542,11 +3552,15 @@ virQEMUCapsLoadCache(virArch hostArch, =20 if ((virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_K= VM) < 0) || + (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF) && + virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_H= VF) < 0) || virQEMUCapsLoadHostCPUModelInfo(qemuCaps, ctxt, VIR_DOMAIN_VIRT_QE= MU) < 0) goto cleanup; =20 if ((virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_KVM) < 0= ) || + (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF) && + virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_HVF) < 0= ) || virQEMUCapsLoadCPUModels(qemuCaps, ctxt, VIR_DOMAIN_VIRT_QEMU) < 0) goto cleanup; =20 @@ -3661,6 +3675,8 @@ virQEMUCapsLoadCache(virArch hostArch, =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_HVF); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 ret =3D 0; @@ -3841,10 +3857,14 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_KV= M); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_HV= F); virQEMUCapsFormatHostCPUModelInfo(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU= ); =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_HVF); virQEMUCapsFormatCPUModels(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU); =20 for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { @@ -4455,7 +4475,7 @@ virQEMUCapsInitQMPCommandRun(virQEMUCapsInitQMPComman= dPtr cmd, if (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", cmd->binary, machine); @@ -4646,6 +4666,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_HVF); virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808979405539.6209163885783; Wed, 21 Nov 2018 06:02:59 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 9A0A8A0378; Wed, 21 Nov 2018 14:02:56 +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 441227E387; Wed, 21 Nov 2018 14:02:56 +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 DCE2E181B9E3; Wed, 21 Nov 2018 14:02:55 +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 wALE2rC3020089 for ; Wed, 21 Nov 2018 09:02:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 986CE27BBE; Wed, 21 Nov 2018 14:02:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89DCA277B3 for ; Wed, 21 Nov 2018 14:02:42 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EDA530842CE for ; Wed, 21 Nov 2018 14:02:41 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 3AEE54194B for ; Wed, 21 Nov 2018 14:02:40 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VWU8RUeLSRdb for ; Wed, 21 Nov 2018 17:02:39 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id B965E41950 for ; Wed, 21 Nov 2018 17:02:22 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:22 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808959; x=1544623360; bh=SllIFS3MUZsj0l7YDufOaVK+dG/aQkuLr2d 9c4EPnx0=; b=N3O+QmhtSWCNWM+jxW8cXAOWx/tQjhGTW4963RcxXgC/N6yxxxI 9IVkuEwTDgsyLofoqdHL3OF953CgZnCbT5tGf/a/M9XxD12/t/NxX4n/rw8kAwEy riR6uvAEdigQ4mh4ca3yTiLZeadTcJBAHnBOQMBWn7T4YIdeVgm9mUhw= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:56 +0300 Message-ID: <20181121140159.3751-14-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 21 Nov 2018 14:02:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 21 Nov 2018 14:02:41 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 13/16] news: Mention hvf domain type 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Nov 2018 14:02:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Roman Bolshakov --- docs/news.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 4406aeb775..90e378187d 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -68,6 +68,18 @@ be viewed via the domain statistics. + + + qemu: Add hvf domain type for Hypervisor.framework + + + QEMU introduced experimental support of Hypervisor.framework + since 2.12. + + It's supported on machines with Intel VT-x feature set that incl= udes + Extended Page Tables (EPT) and Unrestricted Mode since macOS 10.= 10. + +
--=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808991046924.9511673902488; Wed, 21 Nov 2018 06:03:11 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id A636730B3256; Wed, 21 Nov 2018 14:03:08 +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 6CF4262671; Wed, 21 Nov 2018 14:03:08 +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 1FE4C3F60A; Wed, 21 Nov 2018 14:03:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE36DT020173 for ; Wed, 21 Nov 2018 09:03:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 538A18569D; Wed, 21 Nov 2018 14:03:06 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A41E585661 for ; Wed, 21 Nov 2018 14:02:53 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20FCF30024EA for ; Wed, 21 Nov 2018 14:02:47 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id ADF8541925 for ; Wed, 21 Nov 2018 14:02:45 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mJKl-LCIhVM4 for ; Wed, 21 Nov 2018 17:02:40 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id C152C41951 for ; Wed, 21 Nov 2018 17:02:23 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:23 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808960; x=1544623361; bh=B26GEWCbDhfwcqccb+hRksf8VHmFlTVSomF GJbhHd2c=; b=UfGHPx2TTu8mzTAo1WNhoXZqhaJa/+M02jGOQcoI8VsI8m/+szg B0FZ+8dkHEO1p+fr5dEJx67/m4hgvQq4FF0fXgtsgki2DabgberpkRO0nH2PQQbV SCBOpI3/1syDfNk2UfIsikMhIxAL7+lMFQZdk0wxywa98lPyMiBxpXUg= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:57 +0300 Message-ID: <20181121140159.3751-15-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:02:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:02:47 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 14/16] docs: Add hvf on QEMU driver page 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 14:03:10 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It's worth to make the domain type a little bit more visible than a row in news. An example of hvf domain is available on QEMU driver page. While at it, mention Hypervisor.framework on index page. Signed-off-by: Roman Bolshakov --- docs/drvqemu.html.in | 49 +++++++++++++++++++++++++++++++++++++++++--- docs/index.html.in | 1 + 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/docs/drvqemu.html.in b/docs/drvqemu.html.in index 0d14027646..7c511ce3b6 100644 --- a/docs/drvqemu.html.in +++ b/docs/drvqemu.html.in @@ -2,13 +2,16 @@ -

KVM/QEMU hypervisor driver

+

QEMU/KVM/HVF hypervisor driver

=20
    =20

    - The libvirt KVM/QEMU driver can manage any QEMU emulator from - version 1.5.0 or later. + The libvirt QEMU driver can manage any QEMU emulator from + version 1.5.0 or later. It supports multiple QEMU accelerators: soft= ware + emulation also known as TCG, hardware-assisted virtualization on Lin= ux + with KVM and hardware-assisted virtualization on macOS with + Hypervisor.framework (since 4.10.0).

    =20

    Project Links

    @@ -21,6 +24,9 @@
  • The QEMU emulator
  • +
  • + H= ypervisor.framework reference +
  • =20

    Deployment pre-requisites

    @@ -41,6 +47,13 @@ node. If both are found, then KVM fullyvirtualized, hardware accel= erated guests will be available. +
  • + Hypervisor.framework (HVF): The driver will probe + sysctl for the presence of + Hypervisor.framework. If it is found and QEMU is newer + than 2.12, then it will be possible to create hardware accelerated + guests. +
  • =20

    Connections to QEMU driver

    @@ -640,5 +653,35 @@ $ virsh domxml-to-native qemu-argv demo.xml </devices> </domain> =20 +

    HVF hardware accelerated guest on x86_64

    + +
    <domain type=3D'hvf'>
    +  <name>hvf-demo</name>
    +  <uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid>
    +  <memory>131072</memory>
    +  <vcpu>1</vcpu>
    +  <os>
    +    <type arch=3D"x86_64">hvm</type>
    +  </os>
    +  <features>
    +    <acpi/>
    +  </features>
    +  <clock sync=3D"localtime"/>
    +  <devices>
    +    <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
    +    <controller type=3D'scsi' index=3D'0' model=3D'virtio-scsi'/>
    +    <disk type=3D'volume' device=3D'disk'>
    +      <driver name=3D'qemu' type=3D'qcow2'/>
    +      <source pool=3D'default' volume=3D'myos'/>
    +      <target bus=3D'scsi' dev=3D'sda'/>
    +    </disk>
    +    <interface type=3D'user'>
    +      <mac address=3D'24:42:53:21:52:45'/>
    +      <model type=3D'virtio'/>
    +    </interface>
    +    <graphics type=3D'vnc' port=3D'-1'/>
    +  </devices>
    +</domain>
    + diff --git a/docs/index.html.in b/docs/index.html.in index 1f9f448399..b02802fdd9 100644 --- a/docs/index.html.in +++ b/docs/index.html.in @@ -32,6 +32,7 @@
  • is accessible from C, Python, Perl, Java and more
  • is licensed under open source licenses
  • supports KVM, + Hypervisor.framework, QEMU, Xen, Virtuozzo, VMWare ESX, --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808992364987.318433828167; Wed, 21 Nov 2018 06:03:12 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 51F5C30833C5; Wed, 21 Nov 2018 14:03:10 +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 8BB34226FC; Wed, 21 Nov 2018 14:03:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 125FF3F60D; Wed, 21 Nov 2018 14:03:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALE36q5020169 for ; Wed, 21 Nov 2018 09:03:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 486D78569C; Wed, 21 Nov 2018 14:03:06 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A587F85684 for ; Wed, 21 Nov 2018 14:02:53 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EA8CC04FFEA for ; Wed, 21 Nov 2018 14:02:46 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 0D40D4194B for ; Wed, 21 Nov 2018 14:02:45 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id suW1l9PpeJ2Z for ; Wed, 21 Nov 2018 17:02:43 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 054E741925 for ; Wed, 21 Nov 2018 17:02:25 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:24 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808963; x=1544623364; bh=yedCd88UurVaGJEOVxAvyU0UpMdOYDsWA6X iXainERI=; b=QS3KbwamzL1nU7DC5Xro/ES7FGW03+ucrKa+seSHiHuj8vck7QD v5reG3pg+g282NSgaghNHOmtWCApYjzM2lbx8/IiLmhHoSItIhqRTgu/1m/ysfDS X/BjA59IMcDuVmE2VEyThnXOfcXFX8dxvB5NG8zqUNCqaghIj2jh498k= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:58 +0300 Message-ID: <20181121140159.3751-16-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 21 Nov 2018 14:02:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 21 Nov 2018 14:02:47 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 15/16] docs: Note hvf support for domain elements 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 21 Nov 2018 14:03:11 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Many domain elements have "QEMU and KVM only" or "QEMU/KVM since x.y.z" remarks. Most of the elements work for HVF domain, so it makes sense to add respective notices for HVF domain. All the elements have been manually tested. Signed-off-by: Roman Bolshakov --- docs/formatdomain.html.in | 133 ++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 56 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 25dd4bbbd6..b1a64c7c74 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -158,10 +158,10 @@ which is specified by absolute path, used to assist the domain creation process. It is used by Xen fully virtualized domains as well as setting the QEMU BIOS file - path for QEMU/KVM domains. Xen since 0.1.0, - QEMU/KVM since 0.9.12 Then, since - 1.2.8 it's possible for the element to have two - optional attributes: readonly (accepted values are + path for QEMU/KVM/HVF domains. Xen since 0.1= .0, + QEMU/KVM since 0.9.12, HVF since 4.10.0 Then, since 1.2.8 it's possible for the element t= o have + two optional attributes: readonly (accepted values are yes and no) to reflect the fact that the image should be writable or read-only. The second attribute type accepts values rom and @@ -680,7 +680,7 @@ IOThreads are dedicated event loop threads for supported disk devices to perform block I/O requests in order to improve scalability especially on an SMP host/guest with many LUNs. - Since 1.2.8 (QEMU only) + QEMU/KVM since 1.2.8, HVF since 4.10.0

    =20
    @@ -1603,12 +1603,13 @@
    =20
             Both host-model and host-passthrough mod=
    es
             make sense when a domain can run directly on the host CPUs (for
    -        example, domains with type kvm). The actual host CPU =
    is
    -        irrelevant for domains with emulated virtual CPUs (such as domains=
     with
    -        type qemu). However, for backward compatibility
    -        host-model may be implemented even for domains runnin=
    g on
    -        emulated CPUs in which case the best CPU the hypervisor is able to
    -        emulate may be used rather then trying to mimic the host CPU model.
    +        example, domains with type kvm or hvf). =
    The
    +        actual host CPU is irrelevant for domains with emulated virtual CP=
    Us
    +        (such as domains with type qemu). However, for backwa=
    rd
    +        compatibility host-model may be implemented even for
    +        domains running on emulated CPUs in which case the best CPU the
    +        hypervisor is able to emulate may be used rather then trying to mi=
    mic
    +        the host CPU model.
           
    =20
           
    model
    @@ -1902,12 +1903,12 @@ =20

    - QEMU/KVM supports the on_poweroff and on_reboot - events handling the destroy and restart acti= ons. - The preserve action for an on_reboot event - is treated as a destroy and the rename-restart - action for an on_poweroff event is treated as a - restart event. + QEMU/KVM/HVF domains support the on_poweroff and + on_reboot events handling the destroy and + restart actions. The preserve action for an + on_reboot event is treated as a destroy and = the + rename-restart action for an on_poweroff eve= nt is + treated as a restart event.

    =20

    @@ -2043,7 +2044,7 @@ to address more than 4 GB of memory.

    acpi
    ACPI is useful for power management, for example, with - KVM guests it is required for graceful shutdown to work. + KVM or HVF guests it is required for graceful shutdown to work.
    apic
    APIC allows the use of programmable IRQ @@ -2286,7 +2287,8 @@
    vmcoreinfo
    Enable QEMU vmcoreinfo device to let the guest kernel save debug - details. Since 4.4.0 (QEMU only) + details. QEMU/KVM since 4.4.0, HVF since + 4.10.0
    htm
    Configure HTM (Hardware Transational Memory) availability for @@ -3559,7 +3561,7 @@ Copy-on-read avoids accessing the same backing file sectors repeatedly and is useful when the backing file is over a slow network. By default copy-on-read is off. - Since 0.9.10 (QEMU and KVM only) + QEMU/KVM since 0.9.10, HVF since 4.10.0<= /span>
  • The optional discard attribute controls whether @@ -3567,7 +3569,7 @@ ignored or passed to the filesystem. The value can be either "unmap" (allow the discard request to be passed) or "ignore" (ignore the discard request). - Since 1.0.6 (QEMU and KVM only) + QEMU/KVM since 1.0.6, HVF since 4.10.0
  • The optional detect_zeroes attribute controls whe= ther @@ -3723,7 +3725,7 @@
    blockio
    If present, the blockio element allows to override any of the block device properties listed below. - Since 0.10.2 (QEMU and KVM) + QEMU/KVM since 0.10.2, HVF since 4.10.0
    logical_block_size
    The logical block size the disk will report to the guest @@ -4157,14 +4159,14 @@ The optional queues attribute specifies the number of queues for the controller. For best performance, it's recommended = to specify a value matching the number of vCPUs. - Since 1.0.5 (QEMU and KVM only) + QEMU/KVM since 1.0.5, HVF since 4.10.0
    cmd_per_lun
    The optional cmd_per_lun attribute specifies the maxi= mum number of commands that can be queued on devices controlled by the host. - Since 1.2.7 (QEMU and KVM only) + QEMU/KVM since 1.2.7, HVF since 4.10.0
    max_sectors
    @@ -4172,7 +4174,7 @@ amount of data in bytes that will be transferred to or from the de= vice in a single command. The transfer length is measured in sectors, w= here a sector is 512 bytes. - Since 1.2.7 (QEMU and KVM only) + QEMU/KVM since 1.2.7, HVF since 4.10.0
    ioeventfd
    @@ -4268,7 +4270,8 @@ unit attribute) the 64-bit PCI hole should be. Some gue= sts (like Windows XP or Windows Server 2003) might crash when QEMU and Seabios are recent enough to support 64-bit PCI holes, unless this is disabl= ed - (set to 0). Since 1.1.2 (QEMU only) + (set to 0). QEMU/KVM since 1.1.2, HVF since + 4.10.0

    PCI controllers also have an optional @@ -4280,8 +4283,8 @@ model attribute. In almost all cases, you should not manually add a <model> subelement to a controller, nor should you modify one that is automatically - generated by libvirt. Since 1.2.19 (QEMU - only). + generated by libvirt. QEMU/KVM since 1.2.19, H= VF + since 4.10.0

    PCI controllers also have an optional @@ -4293,7 +4296,8 @@ should not manually add a <target> subelement to a controller, nor should you modify the values in the those that are automatically generated by - libvirt. Since 1.2.19 (QEMU only). + libvirt. QEMU/KVM since 1.2.19, HVF since 4.10= .0 +

    chassisNr
    @@ -5681,7 +5685,7 @@

    The values for type aren't defined specifically by libvirt, but by what the underlying hypervisor supports (if - any). For QEMU and KVM you can get a list of supported models + any). For QEMU, KVM and HVF you can get a list of supported models with these commands:

    =20 @@ -5691,7 +5695,7 @@ qemu-kvm -net nic,model=3D? /dev/null =20

    - Typical values for QEMU and KVM include: + Typical values for QEMU, KVM and HVF include: ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio

    =20 @@ -5730,7 +5734,7 @@ qemu-kvm -net nic,model=3D? /dev/null will be rejected. If this attribute is not present, then the domain defaults to 'vhost' if present, but silently falls back to 'qemu' without error. - Since 0.8.8 (QEMU and KVM only) + QEMU/KVM since 0.8.8, HVF since 4.10.0
    For interfaces of type=3D'hostdev' (PCI passthrough devices) @@ -5755,7 +5759,8 @@ qemu-kvm -net nic,model=3D? /dev/null The txmode attribute specifies how to handle transmission of packets when the transmit buffer is full. The value can be either 'iothread' or 'timer'. - Since 0.8.8 (QEMU and KVM only)
    <= br/> + QEMU/KVM since 0.8.8, HVF since 4.10.0 +

    =20 If set to 'iothread', packet tx is all done in an iothread in the bottom half of the driver (this option translates into @@ -5801,7 +5806,8 @@ qemu-kvm -net nic,model=3D? /dev/null usually if the feature is supported, default is on. In case there is a situation where this behavior is suboptimal, this attribute provides a way to force the feature off. - Since 0.9.5 (QEMU and KVM only)
    <= br/> + QEMU/KVM since 0.9.5, HVF since 4.10.0 +

    =20 In general you should leave this option alone, unless you are very certain you know what you are doing. @@ -5828,7 +5834,8 @@ qemu-kvm -net nic,model=3D? /dev/null some restrictions on actual value. For instance, latest QEMU (as of 2016-09-01) requires value to be a power of two from [256, 1024] range. - Since 2.3.0 (QEMU and KVM only)
    <= br/> + QEMU/KVM since 2.3.0, HVF since 4.10.0 +

    =20 In general you should leave this option alone, unless you are very certain you know what you are doing. @@ -5844,7 +5851,8 @@ qemu-kvm -net nic,model=3D? /dev/null range. In addition to that, this may work only for a subset of interface types, e.g. aforementioned QEMU enables this option only for vhostuser type. - Since 3.7.0 (QEMU and KVM only)
    <= br/> + QEMU/KVM since 3.7.0, HVF since 4.10.0 +

    =20 In general you should leave this option alone, unless you are very certain you know what you are doing. @@ -6748,7 +6756,10 @@ qemu-kvm -net nic,model=3D? /dev/null of the first forward dev will be used.

    -
    socket since 2.0.0 (QEMU only= )
    +
    + socket QEMU/KVM since 2.0.0, HVF + since 4.10.0 +

    This listen type tells a graphics server to listen on unix socke= t. @@ -6764,7 +6775,10 @@ qemu-kvm -net nic,model=3D? /dev/null attribute all listen elements are ignored.

    -
    none since 2.0.0 (QEMU only)<= /span>
    +
    + none QEMU/KVM since 2.0.0, HVF + since 4.10.0 +

    This listen type doesn't have any other attribute. Libvirt suppo= rts @@ -6838,19 +6852,21 @@ qemu-kvm -net nic,model=3D? /dev/null

    You can provide the amount of video memory in kibibytes (blocks = of 1024 bytes) using vram. This is supported only for = guest - type of "libxl", "vz", "qemu", "vbox", "vmx" and "xen". If no - value is provided the default is used. If the size is not a powe= r of - two it will be rounded to closest one. + type of "libxl", "vz", "qemu", "kvm", "hvf", "vbox", "vmx" and "= xen". + If no value is provided the default is used. If the size is not a + power of two it will be rounded to closest one.

    The number of screen can be set using heads. This is - supported only for guests type of "vz", "kvm", "vbox" and "vmx". + supported only for guests type of "vz", "kvm", "hvf", "vbox" and + "vmx".

    - For guest type of "kvm" or "qemu" and model type "qxl" there are - optional attributes. Attribute ram ( - since 1.0.2) specifies the size of the primary bar, while= the - attribute vram specifies the secondary bar size. + For guest type of "kvm", "hvf" or "qemu" and model type "qxl" th= ere + are optional attributes. Attribute ram ( since 1.0.2) specifies the size of the p= rimary + bar, while the attribute vram specifies the seconda= ry bar + size. If ram or vram are not supplied a defa= ult value is used. The ram should also be rounded to po= wer of two as vram. There is also optional attribute @@ -7735,7 +7751,7 @@ qemu-kvm -net nic,model=3D? /dev/null

    A virtual hardware watchdog device can be added to the guest via the watchdog element. - Since 0.7.3, QEMU and KVM only + QEMU/KVM since 0.7.3, HVF since 4.10.0

    =20

    @@ -7773,12 +7789,17 @@ qemu-kvm -net nic,model=3D? /dev/null underlying hypervisor.

    - QEMU and KVM support: + QEMU, KVM and HVF support:

    • 'i6300esb' - the recommended device, emulating a PCI Intel 6300ESB
    • 'ib700' - emulating an ISA iBase IB700
    • +
    +

    + QEMU and KVM for s390/s390x support: +

    +
    • 'diag288' - emulating an S390 DIAG288 device Since 1.2.17
    @@ -7791,7 +7812,7 @@ qemu-kvm -net nic,model=3D? /dev/null specific to the underlying hypervisor.

    - QEMU and KVM support: + QEMU, KVM and HVF support:

    • 'reset' - default, forcefully reset the guest
    • @@ -7823,14 +7844,14 @@ qemu-kvm -net nic,model=3D? /dev/null

      Memory balloon device

      =20

      - A virtual memory balloon device is added to all Xen and KVM/QEMU + A virtual memory balloon device is added to all Xen and QEMU/KVM/HVF guests. It will be seen as memballoon element. It will be automatically added when appropriate, so there is no need to explicitly add this element in the guest XML unless a specific PCI slot needs to be assigned. - Since 0.8.3, Xen, QEMU and KVM only - Additionally, since 0.8.4, if the - memballoon device needs to be explicitly disabled, + Xen, QEMU and KVM since 0.8.3, HVF since + 4.10.0 Additionally, since 0.8.4= , if + the memballoon device needs to be explicitly disabled, model=3D'none' may be used.

      =20 @@ -7867,7 +7888,7 @@ qemu-kvm -net nic,model=3D? /dev/null the virtualization platform

        -
      • 'virtio' - default with QEMU/KVM
      • +
      • 'virtio' - default with QEMU/KVM/HVF
      • 'xen' - default with Xen
    @@ -8148,7 +8169,7 @@ qemu-kvm -net nic,model=3D? /dev/null

    panic device enables libvirt to receive panic notification from a QE= MU guest. - Since 1.2.1, QEMU and KVM only + QEMU/KVM since 1.2.1, HVF since 4.10.0

    This feature is always enabled for: @@ -8816,7 +8837,7 @@ qemu-kvm -net nic,model=3D? /dev/null =20

    --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:12:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542808984171247.57623396290137; Wed, 21 Nov 2018 06:03:04 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 38CE77654C; Wed, 21 Nov 2018 14:03:01 +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 E4362871C3; Wed, 21 Nov 2018 14:03:00 +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 5A67B181B9F6; Wed, 21 Nov 2018 14:03:00 +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 wALE2rfh020090 for ; Wed, 21 Nov 2018 09:02:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9878027BBF; Wed, 21 Nov 2018 14:02:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B13027BBB for ; Wed, 21 Nov 2018 14:02:51 +0000 (UTC) Received: from mta-01.yadro.com (mta-01.yadro.com [89.207.88.251]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F603315486E for ; Wed, 21 Nov 2018 14:02:49 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id C08C04194E for ; Wed, 21 Nov 2018 14:02:47 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x9ZCjPNOhjy4 for ; Wed, 21 Nov 2018 17:02:45 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 348D641931 for ; Wed, 21 Nov 2018 17:02:26 +0300 (MSK) Received: from localhost (172.17.1.58) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 21 Nov 2018 17:02:25 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1542808965; x=1544623366; bh=qHkqxcPUg8dWVTBqm+tDPujXOMUJGv82s83 JMU+tyzI=; b=Tv1R+JxMgFPFhvcln0269PjmKGfrbdsZWY6YaGsNXZz3fNfl6zp VEtTdBK/k2fdUDTJt4XajIP8Tnv463gCX7hqNwz/C6RxAtRllcyoZ4YA9GBm4r4k vjslCZyXquYtg2zKAv2Q2dQoObgw/AWbUpBI1X5pn9qyRVRyxFsFk7eM= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Wed, 21 Nov 2018 17:01:59 +0300 Message-ID: <20181121140159.3751-17-r.bolshakov@yadro.com> In-Reply-To: <20181121140159.3751-1-r.bolshakov@yadro.com> References: <20181121140159.3751-1-r.bolshakov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.1.58] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 21 Nov 2018 14:02:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 21 Nov 2018 14:02:49 +0000 (UTC) for IP:'89.207.88.251' DOMAIN:'mta-01.yadro.com' HELO:'mta-01.yadro.com' FROM:'r.bolshakov@yadro.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_PASS) 89.207.88.251 mta-01.yadro.com 89.207.88.251 mta-01.yadro.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Roman Bolshakov Subject: [libvirt] [PATCHv2 16/16] docs: Add support page for libvirt on macOS 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Nov 2018 14:03:02 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" While at it, rename OS-X on index page to macOS. Signed-off-by: Roman Bolshakov --- docs/docs.html.in | 3 + docs/index.html.in | 3 +- docs/macos.html.in | 229 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 docs/macos.html.in diff --git a/docs/docs.html.in b/docs/docs.html.in index 40e0e3b82e..84a51a55fb 100644 --- a/docs/docs.html.in +++ b/docs/docs.html.in @@ -12,6 +12,9 @@
    Windows
    Downloads for Windows
    =20 +
    macOS
    +
    Working with libvirt on macOS
    +
    Migration
    Migrating guests between machines
    =20 diff --git a/docs/index.html.in b/docs/index.html.in index b02802fdd9..34b491ec69 100644 --- a/docs/index.html.in +++ b/docs/index.html.in @@ -39,7 +39,8 @@ LXC, BHyve and more
  • -
  • targets Linux, FreeBSD, Windows a= nd OS-X
  • +
  • targets Linux, FreeBSD, Windows a= nd + macOS
  • is used by many applications
  • Recent / forthcoming release changes

    diff --git a/docs/macos.html.in b/docs/macos.html.in new file mode 100644 index 0000000000..54c93ea2fb --- /dev/null +++ b/docs/macos.html.in @@ -0,0 +1,229 @@ + + + + +

    macOS support

    + +
      + +

      + Libvirt works both as client and server (for + "qemu" domain) on macOS High Sierra (10.13) and macOS Mojave (10= .14) + since 4.7.0. Other macOS variants likely work but we neither tested = nor + received reports for them. +

      + +

      + "hvf" domain type adds support of + Hypervisor.framework since 4.10.0. To use "hvf" domain, QEMU must + be at least 2.12 and macOS must be no less than Yosemite (10.10). "h= vf" + domain type is similar to "kvm" but it has less features. +

      + +

      + Hypervisor.framework is available on your machine if the sysctl comm= and + returns 1: + +

      sysctl -n kern.hv_support
      +

      + +

      Installation

      + +

      + libvirt client (virsh), server (libvirtd) and development headers ca= n be + installed from homebrew: + +

      brew install libvirt
      + + virt-manager and virt-viewer= can be + installed from source via + Jeffrey Wildman's tap: + +
      brew tap jeffreywildman/homebrew-virt-manager
      +brew install virt-manager virt-viewer
      +

      + +

      Running libvirtd locally

      + +

      + The server can be started manually: +

      libvirtd
      + or on system boot: +
      brew services start libvirt
      +

      +

      + Once started, you can use virsh to work with libvirtd: +

      virsh define domain.xml
      +virsh start domain
      +virsh shutdown domain
      + + For more details on virsh, please see v= irsh + command reference or built-in help: +
      virsh help
      +

      + +

      + Domain XML examples can be found on QEMU + driver page. Full reference is available on domain XML format page. +

      + +

      + You can use virt-manager to connect to libvirtd (connection URI must= be + specified on the first connection, then it'll be possible to omit it= ): +

      virt-manager -c qemu:///session
      + or, if you only need an access to the virtual display of a VM you ca= n use + virt-viewer: +
      virt-viewer -c qemu:///session
      +

      + +

      Working with external hypervisors

      +

      + Details on the example domain XML files, capabilities and connection + string syntax used for connecting to external hypervisors can be fou= nd + online on hypervisor specific driver + pages. +

      + +

      TLS Certificates

      + +

      + TLS certificates must be placed in the correct locations, before you= will + be able to connect to QEMU servers over TLS. +

      + +

      + Information on generating TLS certificates can be found here: +

      + + http://wiki.libvirt.= org/page/TLSSetup + +

      + The Certificate Authority (CA) certificate file must be placed in: +

      + +
        +
      • ~/.cache/libvirt/pki/CA/cacert.pem
      • +
      + +

      + The Client certificate file must be placed in: +

      + +
        +
      • ~/.cache/libvirt/pki/libvirt/clientcert.pem
      • +
      + +

      + The Client key file must be placed in: +

      + +
        +
      • ~/.cache/libvirt/pki/libvirt/private/clientkey.pem
      • +
      + +

      Known issues

      +

      + This is a list of issues that can be easily fixed and provide + substantial improvement of user experience: +

      +
        +
      • + virt-install doesn't work unless disks are created upfront. The re= ason + is because VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA sets + preallocate=3Dfalloc which is not supported by qemu-img on macOS. +
      • +
      • + "hvf" is not default domain type when virt-install connects to the + local libvirtd on macOS +
      • +
      • + QXL VGA device and SPICE display cannot be used unless QEMU is com= piled + with SPICE server. The changes to build and run SPICE server on ma= cOS + haven't been sent to upstream yet. +
      • +
      • + "make check" reports many failing tests on macOS. Some of the tests + need to be adopted to run both on Linux and macOS. +
      • +
      • + "make syntax-check" needs be fixed too, it depends on GNU version = of + grep but uses system (BSD) grep. +
      • +
      • + QEMU from homebrew is compiled without USB redirection support. +
      • +
      • + CPU usage is not gathered for VMs and therefore cannot be dispalye= d in + virt-manager. +
      • +
      • + libvirtd logs are noisy because some features are missing. +
      • +
      + +

      Missing features

      +

      + "hvf" is a new domain type and can't be compared to "kvm" feature-wi= se. + "kvm" domain relies on QEMU backend devices implemented in Linux ker= nel + such as para-virtualized vhost devices and PCI-passthrough with vfio. + + Nonetheless, some of the features available in "kvm" domain can be + implemented in userspace for "hvf" domain. +

      +
        +
      • + Instruction emulation in "hvf" accelerator is not mature. The bugs= are + tracked on QEM= U bug + tracker. +
      • +
      • + Power Management notifications are not implemented, therefore gues= ts + cannot respond to + sleep events on the host. +
      • +
      • + CPU pinning doesn't work but macOS provides + Thread Affinity API that can be used to implement it. +
      • +
      • + Network management is not available but macOS has an API that is u= sed + by ifconfig to create bridge and tap devices. So, it should be pos= sible + to implement network management and bridged networking. +
      • +
      • + Filesystem pass-through is not available. +
      • +
      • + PCI/SCSI/USB pass-through is not available. +
      • +
      + + +

      Feedback

      + +

      + Feedback and suggestions on changes and what else to include + are desired. +

      + +

      Compiling yourself

      + +

      + Use these options when following the instructions on the + Compiling page. +

      + +
      +./configure \
      +  --without-wireshark-dissector \
      +  --without-dbus
      +
      + + + --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list