From nobody Sun Feb 8 10:48:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585338699; cv=none; d=zohomail.com; s=zohoarc; b=dqzD/JU0Pu8+20dS8LBl+wuaBB2uinPRPf7CB8Gtr9UiL9rIQfmt3rXJIPhSStFiCPEqFec5Sc+COcrc7ex1kycpxIiEweMRlYQnk0yaq24SplwzXH9hKcSjK52LcYPzkaFC4K4CEVVi7d3JzoKmICNIqojXVW8xGIqkA6Rqduk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585338699; 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=TU6Qkq6RNR4hLC6PsKnTlAtLeL6slL7dq592OqS0nYQ=; b=KX++1d3ykKTDioLZHD3WzeXMIAoeLStQKyJJgqbXPUfWqUHzGYkW86PP1gAwF6qlDZGhDna8QnYCtT5DSOfpvz5QmWM9ExwBOK5Dx8jUDVDewHmTD1OjRrqLBLI0k1K5qJUh63TNpQNyYZWREnFQBPx+ApzHg7h4iUcjTkGlpM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585338699745223.61650387364182; Fri, 27 Mar 2020 12:51:39 -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-143-hAxzj0izPJCZ7dvO6rSGjg-1; Fri, 27 Mar 2020 15:51:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C37E8800D4E; Fri, 27 Mar 2020 19:51:30 +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 8C42DCDBD2; Fri, 27 Mar 2020 19:51:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2C1A718089D5; Fri, 27 Mar 2020 19:51:30 +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 02RJpShc019810 for ; Fri, 27 Mar 2020 15:51:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 94EA520316F1; Fri, 27 Mar 2020 19:51:28 +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 90FD220316EF for ; Fri, 27 Mar 2020 19:51:26 +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 85DC68007A4 for ; Fri, 27 Mar 2020 19:51:26 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-s2WwC1nHMiuzG8dsjJ-PBA-1; Fri, 27 Mar 2020 15:51:22 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02RJYDUm042278 for ; Fri, 27 Mar 2020 15:51:21 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywe7xfn75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 15:51:21 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02RJkWNm006229 for ; Fri, 27 Mar 2020 19:51:20 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02wdc.us.ibm.com with ESMTP id 2ywawkmrh5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 19:51:20 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02RJpJS056492522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Mar 2020 19:51:19 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 32C546E04C; Fri, 27 Mar 2020 19:51:19 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC5956E053; Fri, 27 Mar 2020 19:51:18 +0000 (GMT) Received: from Tobins-MBP-2.fios-router.home (unknown [9.80.203.249]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 27 Mar 2020 19:51:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585338698; 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=TU6Qkq6RNR4hLC6PsKnTlAtLeL6slL7dq592OqS0nYQ=; b=YTLlWpgCj+IXXagybIuapTXoocq0gERqhcTU3SSvrxFRENRwex8KB+cixQOqPH7iAzDeBb a4FLY7eR0J18VfrQKbXLZm4Vr++jn6M1pw7LQ6kM6OkyU/sbTjwInJD5MgAm0WPnFyOdY9 vT7/L50BGb42RYAQ+aIArgNoDMcYTlg= X-MC-Unique: hAxzj0izPJCZ7dvO6rSGjg-1 X-MC-Unique: s2WwC1nHMiuzG8dsjJ-PBA-1 From: Tobin Feldman-Fitzthum To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] add virQEMUCapsProbeQMPTCGState function to set QEMU_CAPS_TCG_DISABLED Date: Fri, 27 Mar 2020 15:51:14 -0400 Message-Id: <20200327195116.70739-4-tobin@linux.vnet.ibm.com> In-Reply-To: <20200327195116.70739-1-tobin@linux.vnet.ibm.com> References: <20200327195116.70739-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.645 definitions=2020-03-27_07:2020-03-27, 2020-03-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=748 impostorscore=0 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=1 malwarescore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003270159 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 02RJpShc019810 X-loop: libvir-list@redhat.com Cc: Tobin Feldman-Fitzthum X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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" virQEMUCapsProbeQMPTCGState will set QEMU_CAPS_TCG_DISABLED if QEMU version is at least 2.10, KVM is enabled, and qom-list-types does=20 not include tcg-accel. Signed-off-by: Tobin Feldman-Fitzthum --- src/qemu/qemu_capabilities.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9c946339a3..c84ad0e831 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2553,6 +2553,38 @@ virQEMUCapsProbeQMPGenericProps(virQEMUCapsPtr qemuC= aps, return 0; } =20 +static int +virQEMUCapsProbeQMPTCGState(virQEMUCapsPtr qemuCaps, + qemuMonitorPtr mon) +{ + int nvalues; + char **values; + 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; + if ((nvalues =3D qemuMonitorGetObjectTypes(mon, &values)) < 0) + return -1; + + 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); + + virStringListFreeCount(values, nvalues); + return 0; +} + static int virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) --=20 2.20.1 (Apple Git-117)