From nobody Mon Feb 9 00:41:56 2026 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=1570111813; cv=none; d=zoho.com; s=zohoarc; b=WG8uZ6fsFAcigKpT11K6MJ77hvWFY5J9SZdUd3mnOcG3zGLdEAwYcUZC+KD0ERz/znPnPTSO2D1312pC9cBR2uWxQ0m/bWTjqOLwOl4CIuCYAgWuF/FSM+0l0wks+AfsbELI7cnuieElqjcuCuSLHfEegqvOpMejzXjalIouTOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111813; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=3WDFx0cz7ORBFGi2x3Rx437KhvtCabJWVY4FiP7tcBI=; b=fLTDFJF6EoAeUvPTqwYFTC2tlYr6drp96nR1p4FSQ7+ZO7N+Gmr4YkZsUzVgf0EvV1ZMnxG6dupHZwzT7e3fpnXNxe26qZlbASFLfA2T4YGobyaZivOFUmOwJvTffF5fWboIRIWyBBEwQBKhyV81oTzf74PltcURRPkXlD6/3AE= 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 1570111813439292.9172564868529; Thu, 3 Oct 2019 07:10:13 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3C4F83098432; Thu, 3 Oct 2019 14:10:11 +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 0748560C80; Thu, 3 Oct 2019 14:10:11 +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 A66DF6B5C5; Thu, 3 Oct 2019 14:10:10 +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 x93E5pQd021091 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CAFE5D6A9; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 218E95D772 for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 557D31005D8; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:23 +0200 Message-Id: <0841bc61665137fbadc7dcdda01fe373f296d96b.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/22] qemu: Use virQEMUCapsGetCPUDefinitions more 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 03 Oct 2019 14:10:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dac3d3b633..255ae8e665 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5256,24 +5256,17 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, =20 if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype, VIR_CPU_MODE_CUSTOM)) { - virDomainCapsCPUModelsPtr filtered =3D NULL; - char **models =3D NULL; const char *blacklist[] =3D { "host", NULL }; + VIR_AUTOSTRINGLIST models =3D NULL; =20 if (virCPUGetModels(domCaps->arch, &models) >=3D 0) { - virDomainCapsCPUModelsPtr cpus; - - if (domCaps->virttype =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; - else - cpus =3D qemuCaps->tcgCPUModels; - - filtered =3D virDomainCapsCPUModelsFilter(cpus, - (const char **)models, - blacklist); - virStringListFree(models); + domCaps->cpu.custom =3D virQEMUCapsGetCPUDefinitions(qemuCaps, + domCaps->vi= rttype, + (const char= **)models, + blacklist); + } else { + domCaps->cpu.custom =3D NULL; } - domCaps->cpu.custom =3D filtered; } =20 return 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list