From nobody Mon May 20 01:26:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587592706; cv=none; d=zohomail.com; s=zohoarc; b=m0nw/jbl5xG/FBeRz4riiEoMh+T1DxiQk9EYpw3cFbYpGC404IOrBJa4eYcIkZXxjAOgY1NbXTb2dAlXIgrQt/d6xVrvx8IWUlcdExds2pBEnSIaiEmQIUB2vIYG6F0ZcbtNiArwD8VFBrKC8UnrjVBOy1pgu3dtleFhUZUWTDQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587592706; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zh5R7CIbrMFaLA9d8bYN7m53KX8+2CqxxBc9JRJeaG8=; b=RWcFCJxOpm1Bp72NHUVvPsUufanRpmLwVIK5B8g1t8ANBnBPm9Q9im0BY0balbj2rz/iLk2XIY/Akk0FPCXCPByx7DPX+p/4e4Vgkh3UNM5nIE74zpMgR30s5gTPEU6JmBRUtn7sckH+vGPf8Zh0WJx7YOYH25m95yFibIsP4JE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587592706339106.44147185855525; Wed, 22 Apr 2020 14:58:26 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-t9Z8Ya4mNTyLgNHKNYyrRQ-1; Wed, 22 Apr 2020 17:58:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0AB513F6; Wed, 22 Apr 2020 21:58:17 +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 1A3555D70A; Wed, 22 Apr 2020 21:58:17 +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 61228941C9; Wed, 22 Apr 2020 21:58:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03MLtXb3010808 for ; Wed, 22 Apr 2020 17:55:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id C876B2093CE5; Wed, 22 Apr 2020 21:55:33 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4C092026E1C for ; Wed, 22 Apr 2020 21:55:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07C6B811E77 for ; Wed, 22 Apr 2020 21:55:31 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-38-4LebOrasPIGtECBRsmgssg-1; Wed, 22 Apr 2020 17:55:27 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03MLXvHw139775; Wed, 22 Apr 2020 17:55:26 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 30gc2yrwqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 17:55:25 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03MLo4oC009336; Wed, 22 Apr 2020 21:50:48 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03wdc.us.ibm.com with ESMTP id 30fs66mk0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 21:50:48 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03MLojBj60555626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 21:50:45 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0481BE04F; Wed, 22 Apr 2020 21:50:45 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68599BE051; Wed, 22 Apr 2020 21:50:45 +0000 (GMT) Received: from Tobins-MBP-2.fios-router.home (unknown [9.211.72.202]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 22 Apr 2020 21:50:45 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587592705; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Zh5R7CIbrMFaLA9d8bYN7m53KX8+2CqxxBc9JRJeaG8=; b=VCvHPD+Ilon//hKXHt6tyGJFr6wSch4dBJOy3NXoM/MUACOAEKI3m5FEtWymv+a+N1ht68 nxypl3WcoqfAasxFjwceWrXgB382QT1+kjNgjO7DeZpWqk+8NvOABLmk+bYddfs1Mx5eIQ ddvBprtZI6tSnduM4OvR12GvqTmtjlE= X-MC-Unique: t9Z8Ya4mNTyLgNHKNYyrRQ-1 X-MC-Unique: 4LebOrasPIGtECBRsmgssg-1 From: Tobin Feldman-Fitzthum To: libvir-list@redhat.com Subject: [libvirt PATCH v4 1/3] add QEMU_CAPS_TCG_DISABLED and probe conditionally Date: Wed, 22 Apr 2020 17:50:42 -0400 Message-Id: <20200422215044.10300-2-tobin@linux.vnet.ibm.com> In-Reply-To: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> References: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-22_08:2020-04-22, 2020-04-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=811 lowpriorityscore=0 suspectscore=1 bulkscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004220164 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03MLtXb3010808 X-loop: libvir-list@redhat.com Cc: Tobin Feldman-Fitzthum , pkrempa@redhat.com, tobin@ibm.com, dbuono@us.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Only probe QEMU binary with accel=3Dtcg if TCG is not disabled. Similarly, only add a VIR_DOMAIN_VIRT_QEMU guest if TCG is available. Signed-off-by: Tobin Feldman-Fitzthum Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 22 ++++++++++++++-------- src/qemu/qemu_capabilities.h | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fe311048d4..c56b2d8f0e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -573,6 +573,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "fsdev.multidevs", "virtio.packed", "pcie-root-port.hotplug", + "tcg-disabled", ); =20 =20 @@ -1014,13 +1015,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEATURE= _TYPE_DISKSNAPSHOT, true, false); =20 - if (virCapabilitiesAddGuestDomain(guest, - VIR_DOMAIN_VIRT_QEMU, - NULL, - NULL, - 0, - NULL) =3D=3D NULL) - goto cleanup; + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG_DISABLED)) { + if (virCapabilitiesAddGuestDomain(guest, + VIR_DOMAIN_VIRT_QEMU, + NULL, + NULL, + 0, + NULL) =3D=3D NULL) { + goto cleanup; + } + } =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { if (virCapabilitiesAddGuestDomain(guest, @@ -2295,7 +2299,8 @@ bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, virDomainVirtType virtType) { - if (virtType =3D=3D VIR_DOMAIN_VIRT_QEMU) + if (virtType =3D=3D VIR_DOMAIN_VIRT_QEMU && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG_DISABLED)) return true; =20 if (virtType =3D=3D VIR_DOMAIN_VIRT_KVM && @@ -5150,6 +5155,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, * off. */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG_DISABLED) && virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) <= 0) return -1; =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1681fc79a8..abc4ee82cb 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -554,6 +554,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_FSDEV_MULTIDEVS, /* fsdev.multidevs */ QEMU_CAPS_VIRTIO_PACKED_QUEUES, /* virtio.packed */ QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */ + QEMU_CAPS_TCG_DISABLED, /* QEMU does not support TCG */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.20.1 (Apple Git-117) From nobody Mon May 20 01:26:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587592274; cv=none; d=zohomail.com; s=zohoarc; b=Bxs0ZDVhhd2F+VWGq5x9iei08uh0KOMMnNHDRuPw05b0AnnUrQMzzA0deartZZ6Mlj/mWEs3IUWBZP+jkTiI0bbaevKNDXDU/qRkdrgFxutacUuF5Vwd+6RcQYIEmsVuYo1mA8VrfQcjfsKErE4a8Y2PAByHiGxImXMm3bTnPvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587592274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rBwTC2dbZOIivv68lI8ou/0393cqCYz5uPpLsM+4E2M=; b=ie2insFjO/NMi2WBr6KxTqQIbl6KZK13w0htw6Zt5T+RstidT4Ud+jMJ765Ji1A7JCHyKIAgtJw0jTAf0rNFFKk5oKv67GtfKKpodKIfm5VsoTdwEObaHMYMe4OcXcXWvkJTnqdY5i4qMDnBVbWncJwNbBTu/knhxz89mBY68wM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1587592274379293.0928997194479; Wed, 22 Apr 2020 14:51:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-dNhDPgr3NF6SaPoi-_Er8w-1; Wed, 22 Apr 2020 17:51:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0423A801501; Wed, 22 Apr 2020 21:51:04 +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 D21856084A; Wed, 22 Apr 2020 21:51:02 +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 1A1E1941C7; Wed, 22 Apr 2020 21:50:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03MLotsx010566 for ; Wed, 22 Apr 2020 17:50:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 968E4A9F40; Wed, 22 Apr 2020 21:50:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92453AFD42 for ; Wed, 22 Apr 2020 21:50:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3F820857032 for ; Wed, 22 Apr 2020 21:50:53 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-Y_-JTTt8P6OxV7hKakRWnA-1; Wed, 22 Apr 2020 17:50:50 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03MLYaLL121330; Wed, 22 Apr 2020 17:50:49 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 30ghu8e4tg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 17:50:49 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03MLo4oE009336; Wed, 22 Apr 2020 21:50:49 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03wdc.us.ibm.com with ESMTP id 30fs66mk0d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 21:50:49 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03MLokKR17564212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 21:50:46 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3BB1DBE053; Wed, 22 Apr 2020 21:50:46 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6A8DBE051; Wed, 22 Apr 2020 21:50:45 +0000 (GMT) Received: from Tobins-MBP-2.fios-router.home (unknown [9.211.72.202]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 22 Apr 2020 21:50:45 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587592273; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rBwTC2dbZOIivv68lI8ou/0393cqCYz5uPpLsM+4E2M=; b=i/yjMXn1cDNaBZHBuld/nMJJ5l1El/9fZ3F882AofSVyr4MdbbU5hLa5HN0/lgmXmux3+F vGAl8VirQ2pJOQDm6zecZmDKlIU/X5zc0UQyqgK/qRgM5tbTliP207V/7jilDrjK97o+xH akcWVBPFRE4qqnftBcKhT1ZjLCRY3Qc= X-MC-Unique: dNhDPgr3NF6SaPoi-_Er8w-1 X-MC-Unique: Y_-JTTt8P6OxV7hKakRWnA-1 From: Tobin Feldman-Fitzthum To: libvir-list@redhat.com Subject: [libvirt PATCH v4 2/3] add virQEMUCapsGetVirtType convenience function Date: Wed, 22 Apr 2020 17:50:43 -0400 Message-Id: <20200422215044.10300-3-tobin@linux.vnet.ibm.com> In-Reply-To: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> References: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-22_08:2020-04-22, 2020-04-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=543 suspectscore=1 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004220161 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03MLotsx010566 X-loop: libvir-list@redhat.com Cc: Tobin Feldman-Fitzthum , pkrempa@redhat.com, tobin@ibm.com, dbuono@us.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tobin Feldman-Fitzthum --- src/qemu/qemu_capabilities.c | 25 ++++++++++++++++--------- src/qemu/qemu_capabilities.h | 2 ++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c56b2d8f0e..e7179ea048 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4984,6 +4984,20 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr= qemuCaps, #define QEMU_MIN_MINOR 5 #define QEMU_MIN_MICRO 0 =20 +virDomainVirtType +virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps) +{ + virDomainVirtType type; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + type =3D VIR_DOMAIN_VIRT_KVM; + else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG_DISABLED)) + type =3D VIR_DOMAIN_VIRT_QEMU; + else + type =3D VIR_DOMAIN_VIRT_NONE; + + return type; +} + int virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) @@ -5028,11 +5042,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (virQEMUCapsProbeQMPKVMState(qemuCaps, mon) < 0) return -1; =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - type =3D VIR_DOMAIN_VIRT_KVM; - else - type =3D VIR_DOMAIN_VIRT_QEMU; - + type =3D virQEMUCapsGetVirtType(qemuCaps); accel =3D virQEMUCapsGetAccel(qemuCaps, type); =20 if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0) @@ -5525,10 +5535,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, goto cleanup; } =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - capsType =3D VIR_DOMAIN_VIRT_KVM; - else - capsType =3D VIR_DOMAIN_VIRT_QEMU; + capsType =3D virQEMUCapsGetVirtType(qemuCaps); =20 if (virttype =3D=3D VIR_DOMAIN_VIRT_NONE) virttype =3D capsType; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index abc4ee82cb..9a779912fe 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -636,6 +636,8 @@ int virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, bool migratable, char ***features); =20 +virDomainVirtType virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps); + bool virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps, virArch arch); bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, --=20 2.20.1 (Apple Git-117) From nobody Mon May 20 01:26:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587592275; cv=none; d=zohomail.com; s=zohoarc; b=C3RrtidslDeUAdh3VEym/1cQS46BYiCWKpPLS19nBCQm1KlWe+06d0xkdeVneC9rq3llrm2t4042iKt61L54OQ0IjEwFscB6HagdIDXEeNDlEaIkKF1qh/tV2SMKi8RKoetjwOdKs/B2auKehRjoOh1rqDWieC81N4JOcZpMZbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587592275; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KivTbOXS+3oiVjY5ZiKam/jpxyT3EFP4k2ezU9Z8CkY=; b=Cr+QWhnB3sIlsi5LanAqux/lXls8jEi0Tt5NgxMfSZcd44lLNctWxsd7uDfXYNH8hDOLfSKYTpO/VlPGlo32VDLD2OVTnCJ46yI0YzG0UPLV90lMFdemhOIv5pUyrdIFBSX/qMD3sbEmLggl9Q2KUq1iawNHBd4Gu3nkTAWEAKo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587592275261729.7542299371165; Wed, 22 Apr 2020 14:51:15 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-E-6oxuLjN96_GGywcHX4pQ-1; Wed, 22 Apr 2020 17:51:11 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF0711005510; Wed, 22 Apr 2020 21:51:04 +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 0E2B160C63; Wed, 22 Apr 2020 21:51:02 +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 4661E1809541; Wed, 22 Apr 2020 21:50:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03MLou6h010572 for ; Wed, 22 Apr 2020 17:50:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 85BF82026D66; Wed, 22 Apr 2020 21:50:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82081201EFB5 for ; Wed, 22 Apr 2020 21:50:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD4B4802067 for ; Wed, 22 Apr 2020 21:50:53 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-256-NDEh9RW1NNSoUgLZ1HQplQ-1; Wed, 22 Apr 2020 17:50:51 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03MLWnqn106045; Wed, 22 Apr 2020 17:50:50 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 30ghmdx2ke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 17:50:50 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03MLoWu7029742; Wed, 22 Apr 2020 21:50:50 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02dal.us.ibm.com with ESMTP id 30fs675r59-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 21:50:50 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03MLokIP17171042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Apr 2020 21:50:46 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9981BE053; Wed, 22 Apr 2020 21:50:46 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 519D0BE051; Wed, 22 Apr 2020 21:50:46 +0000 (GMT) Received: from Tobins-MBP-2.fios-router.home (unknown [9.211.72.202]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 22 Apr 2020 21:50:46 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587592273; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=KivTbOXS+3oiVjY5ZiKam/jpxyT3EFP4k2ezU9Z8CkY=; b=YAX35T5qezKQ52ihUh3bTKBT5APHm89IvNj9Ed7DnP+g9ttDmATZMLzefPhg1gL18h9QGf kID0vgdommIDf6OMq/iSW5osLucqb0r9Nj/rLA514cIH478TNnMkRkCRLe4u6USuErjgf9 +SmScdQU4SSmkI+rG9FSV2CUITv+c5E= X-MC-Unique: E-6oxuLjN96_GGywcHX4pQ-1 X-MC-Unique: NDEh9RW1NNSoUgLZ1HQplQ-1 From: Tobin Feldman-Fitzthum To: libvir-list@redhat.com Subject: [libvirt PATCH v4 3/3] add virQEMUCapsProbeQMPTCGState function to set QEMU_CAPS_TCG_DISABLED Date: Wed, 22 Apr 2020 17:50:44 -0400 Message-Id: <20200422215044.10300-4-tobin@linux.vnet.ibm.com> In-Reply-To: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> References: <20200422215044.10300-1-tobin@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-22_08:2020-04-22, 2020-04-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 bulkscore=0 phishscore=0 priorityscore=1501 spamscore=0 mlxlogscore=797 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004220161 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03MLou6h010572 X-loop: libvir-list@redhat.com Cc: Tobin Feldman-Fitzthum , pkrempa@redhat.com, tobin@ibm.com, dbuono@us.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add virQEMUCapsProbeQMPTCGState to set TCG_DISABLED cap if version=20 is > 2.10, KVM is enabled, and tcg-accel is not present in=20 qom-list-types result. Signed-off-by: Tobin Feldman-Fitzthum Reviewed-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e7179ea048..4a3170fc5c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2576,7 +2576,35 @@ virQEMUCapsProbeQMPGenericProps(virQEMUCapsPtr qemuC= aps, } =20 static int -virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps, +virQEMUCapsProbeQMPTCGState(virQEMUCapsPtr qemuCaps, + char **values, + int nvalues) +{ + size_t i; + bool found =3D false; + /* + * As of version 2.10, QEMU can be built without the TCG. + * */ + if (qemuCaps->version < 2010000) + return 0; + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + return 0; + + for (i =3D 0; i < nvalues; i++) { + if (STREQ(values[i], "tcg-accel")) { + found =3D true; + break; + } + } + + if (!found) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_TCG_DISABLED); + + return 0; +} + +static int +virQEMUCapsProbeQMPTypes(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) { int nvalues; @@ -2584,6 +2612,8 @@ virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps, =20 if ((nvalues =3D qemuMonitorGetObjectTypes(mon, &values)) < 0) return -1; + + virQEMUCapsProbeQMPTCGState(qemuCaps, values, nvalues); virQEMUCapsProcessStringFlags(qemuCaps, G_N_ELEMENTS(virQEMUCapsObjectTypes), virQEMUCapsObjectTypes, @@ -5047,7 +5077,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, =20 if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0) return -1; - if (virQEMUCapsProbeQMPDevices(qemuCaps, mon) < 0) + if (virQEMUCapsProbeQMPTypes(qemuCaps, mon) < 0) return -1; if (virQEMUCapsProbeQMPMachineTypes(qemuCaps, type, mon) < 0) return -1; --=20 2.20.1 (Apple Git-117)