From nobody Wed Feb 11 10:12:42 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 1490382196001718.0876029823362; Fri, 24 Mar 2017 12:03:16 -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 66ACC7AEAC; Fri, 24 Mar 2017 19:03:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C05E27FCF8; Fri, 24 Mar 2017 19:03:14 +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 693034ED22; Fri, 24 Mar 2017 19:03:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2OJ0X4x019128 for ; Fri, 24 Mar 2017 15:00:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADA6F19630; Fri, 24 Mar 2017 19:00:33 +0000 (UTC) Received: from caroline.brq.redhat.com (dhcp129-198.brq.redhat.com [10.34.129.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368467D569 for ; Fri, 24 Mar 2017 19:00:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 66ACC7AEAC Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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 66ACC7AEAC From: Martin Kletzander To: libvir-list@redhat.com Date: Fri, 24 Mar 2017 19:59:58 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/23] openvz: Ditch openvzGetNodeCPUs 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.25]); Fri, 24 Mar 2017 19:03:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There is particular function for this, there is no need to build whole nodeinfo for it. Signed-off-by: Martin Kletzander --- src/openvz/openvz_conf.c | 14 ++------------ src/openvz/openvz_conf.h | 1 - src/openvz/openvz_driver.c | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index b02e1aab8b86..e4d7634d2eff 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -51,6 +51,7 @@ #include "virfile.h" #include "vircommand.h" #include "virstring.h" +#include "virhostcpu.h" #define VIR_FROM_THIS VIR_FROM_OPENVZ @@ -570,7 +571,7 @@ int openvzLoadDomains(struct openvz_driver *driver) } if (ret =3D=3D 0 || vcpus =3D=3D 0) - vcpus =3D openvzGetNodeCPUs(); + vcpus =3D virHostCPUGetCount(); if (virDomainDefSetVcpusMax(def, vcpus, driver->xmlopt) < 0) goto cleanup; @@ -628,17 +629,6 @@ int openvzLoadDomains(struct openvz_driver *driver) return -1; } -unsigned int -openvzGetNodeCPUs(void) -{ - virNodeInfo nodeinfo; - - if (nodeGetInfo(&nodeinfo) < 0) - return 0; - - return nodeinfo.cpus; -} - static int openvzWriteConfigParam(const char * conf_file, const char *param, const ch= ar *value) { diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h index fc36740d26c6..be7e16df531d 100644 --- a/src/openvz/openvz_conf.h +++ b/src/openvz/openvz_conf.h @@ -67,7 +67,6 @@ int openvzLoadDomains(struct openvz_driver *driver); void openvzFreeDriver(struct openvz_driver *driver); int strtoI(const char *str); int openvzSetDefinedUUID(int vpsid, unsigned char *uuid); -unsigned int openvzGetNodeCPUs(void); int openvzGetVEID(const char *name); int openvzReadNetworkConf(virDomainDefPtr def, int veid); diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index eaa9ef68c576..01ad7628455a 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1362,7 +1362,7 @@ static int openvzDomainSetVcpusInternal(virDomainObjP= tr vm, const char *prog[] =3D { VZCTL, "--quiet", "set", PROGRAM_SENTINEL, "--cpus", str_vcpus, "--save", NULL }; unsigned int pcpus; - pcpus =3D openvzGetNodeCPUs(); + pcpus =3D virHostCPUGetCount(); if (pcpus > 0 && pcpus < nvcpus) nvcpus =3D pcpus; --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list