From nobody Mon Mar 30 03:20:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1488981024447904.1353245454322; Wed, 8 Mar 2017 05:50:24 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DlBWh005236; Wed, 8 Mar 2017 08:47:11 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28DkWxR029143 for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28DkVUR029968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 8 Mar 2017 08:46:32 -0500 Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 617CE102C15; Wed, 8 Mar 2017 14:46:29 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 14:46:26 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] qemu: Refactor virQEMUCapsInitCPU 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function is now called virQEMUCapsProbeHostCPU. Both the refactoring and the change of the name is done for consistency with a new function which will be introduced in the following commit. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 319600c30..08c66b088 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1061,20 +1061,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, } =20 =20 -static int -virQEMUCapsInitCPU(virCapsPtr caps, - virArch arch) +static virCPUDefPtr +virQEMUCapsProbeHostCPU(virCapsPtr caps) { virNodeInfo nodeinfo; =20 if (nodeGetInfo(&nodeinfo)) - return -1; + return NULL; =20 - if (!(caps->host.cpu =3D virCPUGetHost(arch, VIR_CPU_TYPE_HOST, - &nodeinfo, NULL, 0))) - return -1; - - return 0; + return virCPUGetHost(caps->host.arch, VIR_CPU_TYPE_HOST, + &nodeinfo, NULL, 0); } =20 =20 @@ -1120,7 +1116,7 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache) VIR_WARN("Failed to query host NUMA topology, disabling NUMA capab= ilities"); } =20 - if (virQEMUCapsInitCPU(caps, hostarch) < 0) + if (!(caps->host.cpu =3D virQEMUCapsProbeHostCPU(caps))) VIR_WARN("Failed to get host CPU"); =20 /* Add the power management features of the host */ --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list