From nobody Thu May 2 20:42:03 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564043864; cv=none; d=zoho.com; s=zohoarc; b=Xd3DelmIf8i2joMUVrdSO4Gtw/dsEs0oie2Lb7ZD+yimfl6YGtZPo6kUAmnv8gfR5aaG8EcXTcjmUsM6V3Nc+oMrjmFQiJtrsccs/Yp5zPnvKQibSfqEE4MOD8P3vx4+MgUnJKl/YJZMINukzkabP9AAhWM9SHpggMWpiN4Py88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564043864; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=fhqLE+vdum/iCizmYfr06h0RB1ZTeQLyCpz/pUdByos=; b=lyLFKAjsjglfwh3k+dq3LPd8rdc4g0THTW5vOfKnHch/Pp5gAWt3IhM84W/tYXBdahO+cFS4EvOyu+EBwbPduB5XtGQr4JkGlyMn4PYjxWeQpva+o9QTi91BDmKMmQ0g8f0Ew74Z9gygNVBp5arKt7PTFwW4QtsL+YqKYXMNzyA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564043864197667.178989019886; Thu, 25 Jul 2019 01:37:44 -0700 (PDT) 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 0361BC049598; Thu, 25 Jul 2019 08:37:43 +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 D133819D7C; Thu, 25 Jul 2019 08:37:42 +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 9380A1800209; Thu, 25 Jul 2019 08:37:42 +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 x6P8bfR6016018 for ; Thu, 25 Jul 2019 04:37:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B09360606; Thu, 25 Jul 2019 08:37:41 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0B3E60619 for ; Thu, 25 Jul 2019 08:37:37 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 021A5100111; Thu, 25 Jul 2019 10:37:35 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 25 Jul 2019 10:37:34 +0200 Message-Id: <67022e47bf4a2ce669fd229f8d4f776f4da62a4a.1564043854.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Translate features in virQEMUCapsGetCPUFeatures 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.31]); Thu, 25 Jul 2019 08:37:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Starting with QEMU 4.1 qemuMonitorCPUModelInfo structure in virQEMUCaps stores only canonical feature names which may differ from the name used by libvirt. We need translate these canonical names into libvirt names for further consumption. This fixes a bug in qemuConnectBaselineHypervisorCPU which would remove all features for which libvirt's spelling differs from the QEMU's preferred name. For example, the following result of qemuConnectBaselineHypervisorCPU on my host with QEMU 4.1 is wrong: Skylake-Client Intel The 'pclmuldq' and 'lahf_lm' should not be disabled in the baseline CPU as they are supported by QEMU on this host. Signed-off-by: Jiri Denemark Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 65192469da..2388f145af 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2598,7 +2598,8 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, if (migratable && prop->migratable =3D=3D VIR_TRISTATE_BOOL_NO) continue; =20 - if (VIR_STRDUP(list[n++], prop->name) < 0) + if (VIR_STRDUP(list[n++], + virQEMUCapsCPUFeatureFromQEMU(qemuCaps, prop->name)= ) < 0) goto cleanup; } =20 --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list