From nobody Mon Mar 30 00:44:17 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.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; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149209043178768.76296992261018; Thu, 13 Apr 2017 06:33:51 -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 0082637B2DC; Thu, 13 Apr 2017 13:33:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7F947FB97; Thu, 13 Apr 2017 13:33:49 +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 6349865D3A; Thu, 13 Apr 2017 13:33:04 +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 v3DDX35q013052 for ; Thu, 13 Apr 2017 09:33:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id A2432781F2; Thu, 13 Apr 2017 13:33:03 +0000 (UTC) Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 762A678200 for ; Thu, 13 Apr 2017 13:33:00 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B2BA1100096; Thu, 13 Apr 2017 15:32:59 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0082637B2DC Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0082637B2DC From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 13 Apr 2017 15:32:50 +0200 Message-Id: <0b41954c2bdb7a3a61b889093751aa2c35bdda0c.1492090347.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/9] qemu: Introduce virQEMUCapsSetHostModel 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: , MIME-Version: 1.0 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.29]); Thu, 13 Apr 2017 13:33:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" A simple helper as a complement to virQEMUCapsGetHostModel. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3ab99f450..d2b6b7604 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2455,6 +2455,18 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, } =20 =20 +static void +virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + virCPUDefPtr cpu) +{ + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + qemuCaps->kvmCPUModel =3D cpu; + else + qemuCaps->tcgCPUModel =3D cpu; +} + + bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, virCapsPtr caps, @@ -3336,10 +3348,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, goto error; } =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModel =3D cpu; - else - qemuCaps->tcgCPUModel =3D cpu; + virQEMUCapsSetHostModel(qemuCaps, type, cpu); =20 cleanup: virCPUDefFree(hostCPU); --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list