From nobody Thu Mar 28 21:19:54 2024 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=1584974581; cv=none; d=zohomail.com; s=zohoarc; b=m3XXkwjBIkvdp6S9anwUQPqgcFgdWgvRQoryPp1hvK48pa7WAUqjSJHv06UwmGI/z0CCqP7ZgWF00MNs0LzL1I5MsA2nVY1sTjqrgd/ypicZ+eILKQvA+YttIB5xsD2tg6tKvPUZ8x7+9vtUC14z6BmwExUFx8CF219RWR386SY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584974581; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=bjUFVHpYk2J9axqbRyX/LpfZd51DNFlvCaq8zbgReKA=; b=QwpdBRQDVwYei8DBm3mr+UrY3JGT0C35nMqrRHirQh7krYnNEz1qYutvQ6M3dHxbl7QKc+IS4qRsFu0isxQ/X/l4jYFF9PsYxNCvj/txCrWU5RauEubNZL9VD+toFxMtimbOXovBX3LM64M3MFLBOGpvIhXZ5H58IqRcqUvGpx0= 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 1584974581575564.3990262006986; Mon, 23 Mar 2020 07:43:01 -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-309-N5PpgpzKOkyv0pWSrDyVtQ-1; Mon, 23 Mar 2020 10:42:58 -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 5284C100550E; Mon, 23 Mar 2020 14:42: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 E23708AC30; Mon, 23 Mar 2020 14:42:51 +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 D2C9F8A02F; Mon, 23 Mar 2020 14:42:50 +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 02NEgnFU000674 for ; Mon, 23 Mar 2020 10:42:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4370820316E0; Mon, 23 Mar 2020 14:42:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E19220316F5 for ; Mon, 23 Mar 2020 14:42:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 7368A185A7A5 for ; Mon, 23 Mar 2020 14:42:46 +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-491-Haprl2qJOkGQ9nAu7QVktw-1; Mon, 23 Mar 2020 10:42:44 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02NEXG7Z051855 for ; Mon, 23 Mar 2020 10:42:42 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywejvasv5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 23 Mar 2020 10:42:42 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02NEf51F030406 for ; Mon, 23 Mar 2020 14:42:39 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma04dal.us.ibm.com with ESMTP id 2ywawfddbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 23 Mar 2020 14:42:39 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02NEgdp250397466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Mar 2020 14:42:39 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0116EAE05F; Mon, 23 Mar 2020 14:42:39 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC089AE062; Mon, 23 Mar 2020 14:42:38 +0000 (GMT) Received: from Tobins-MBP-2.fios-router.home (unknown [9.80.215.22]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 23 Mar 2020 14:42:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584974580; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bjUFVHpYk2J9axqbRyX/LpfZd51DNFlvCaq8zbgReKA=; b=hDpRS9+9fEX1M534rLqcojcCQKsynYsEDK45raIp48ff+i9ypU/+dT2Js2oyVpICCWNYIp eeq/b7LP3kcPULEVx6JFlU2nb2GAY7V7FVL9a+G1yToG5IVmMjVxq0RsbKzaqBVDCY3yCC KD4mVPA5rChAyQ1jzVMbY3ZyX4wvPws= X-MC-Unique: N5PpgpzKOkyv0pWSrDyVtQ-1 X-MC-Unique: Haprl2qJOkGQ9nAu7QVktw-1 From: Tobin Feldman-Fitzthum To: libvir-list@redhat.com Subject: [PATCH] qemu: softfail for TCG capabilities probe Date: Mon, 23 Mar 2020 10:42:35 -0400 Message-Id: <20200323144235.34614-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-23_05:2020-03-21, 2020-03-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 suspectscore=1 spamscore=0 mlxscore=0 mlxlogscore=712 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003230084 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 02NEgnFU000674 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" As of version 2.10, QEMU can be built without the TCG. When libvirt determi= nes that capabilities of a QEMU binary using QMP, it launches a QEMU proces= s with KVM acceleration and TCG as a fallback. If QEMU supports KVM, a seco= nd probe is performed, forcing QEMU to use only TCG. This causes an error i= f the QEMU binary was built without TCG. This patch allows execution to con= tinue when the second probe fails. Thus libvirt can be used with QEMU built= without TCG. First patch. Feedback appreciated. If better solution, please= advise. Signed-off-by: Tobin Feldman-Fitzthum --- src/qemu/qemu_capabilities.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a95a60c36a..f303171cc4 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5100,9 +5100,6 @@ virQEMUCapsInitQMPSingle(virQEMUCapsPtr qemuCaps, ret =3D virQEMUCapsInitQMPMonitor(qemuCaps, proc->mon); =20 cleanup: - if (ret < 0) - virQEMUCapsLogProbeFailure(qemuCaps->binary); - qemuProcessQMPFree(proc); return ret; } @@ -5114,17 +5111,18 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid) { - if (virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, false) = < 0) + if (virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, false) = < 0) { + virQEMUCapsLogProbeFailure(qemuCaps->binary); return -1; + } =20 /* * If KVM was enabled during the first probe, we need to explicitly pr= obe * for TCG capabilities by asking the same binary again and turning KVM * off. */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && - virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) <= 0) - return -1; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) + virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true); =20 return 0; } --=20 2.20.1 (Apple Git-117)