From nobody Tue May 14 09:18:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1576492623; cv=none; d=zohomail.com; s=zohoarc; b=jyOcZk/ZSOo7O9DTuErqhO694rImYD1gjzSdwaKf14WGj2tLVr0Fxcl7bEFx71Ml1VtMa3Pf/lwi6dR4/BGbF4s8WVtSjGytkbqT7CCehbRAD8c5zfwtoGArWOaM7knjf6w4OcXd2f4AaDxciN9mMdJKo+xrPS91ye80t04GTmw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576492623; 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; bh=vkWNz/eW4qjNf28tUpvgWsj/ntxRO1KKr4RcoCKSQK8=; b=A5TuA8ZeiUUILe8gSLP4aZCIze4xW7rHPT7GE9k/N88seVrdzLr2C2fELAjwKaxN7C883zXOiNh1j9lgW4ZaWHEIc9cFBzTPCvUgFLx/1p+xPjFXBqcxwvfgRa7AtPNnTIQUSFQk0tT2xpTPPNyG4Mviu+NcX5sdBIMxCHnibM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576492623501568.6541976829251; Mon, 16 Dec 2019 02:37:03 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-IBe85h2NNHmjjsGqsiyDDQ-1; Mon, 16 Dec 2019 05:36:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 54DD1800D4C; Mon, 16 Dec 2019 10:36:54 +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 0BCCF5C54A; Mon, 16 Dec 2019 10:36:53 +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 1B18A18089C8; Mon, 16 Dec 2019 10:36:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBGAanJE032466 for ; Mon, 16 Dec 2019 05:36:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 88C241001B08; Mon, 16 Dec 2019 10:36:49 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C2131001B07; Mon, 16 Dec 2019 10:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576492621; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vkWNz/eW4qjNf28tUpvgWsj/ntxRO1KKr4RcoCKSQK8=; b=Oj95rAEoC0n6+cRm2jgs/ljsJhQfuUCKHKhwFFU/xxn9pnW+/QMT4gVRgB2qPsOsWsTOCo Vaf4geV2+REI5rSFgHnFw5951ymei7x+k0RizgovJI9la1BH4BKRcQZrlt0CsCuST0n5MP oxCzYb0J+nKb4kEo4BksVbpBQSFlgRc= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 16 Dec 2019 10:36:40 +0000 Message-Id: <20191216103640.8690-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] src: warn against virNodeGetInfo() API call due to inaccurate info 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: IBe85h2NNHmjjsGqsiyDDQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jiri Denemark --- include/libvirt/libvirt-host.h | 4 ++++ src/libvirt-host.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h index be65b4686b..b87d634813 100644 --- a/include/libvirt/libvirt-host.h +++ b/include/libvirt/libvirt-host.h @@ -147,6 +147,10 @@ typedef virSecurityModel *virSecurityModelPtr; * * a virNodeInfo is a structure filled by virNodeGetInfo() and providing * the information for the Node. + * + * Note that the information in this struct is not guaranteed to be an + * accurate relection of the system hardware. See the virNodeGetInfo() + * API documentation for further guidance. */ =20 typedef struct _virNodeInfo virNodeInfo; diff --git a/src/libvirt-host.c b/src/libvirt-host.c index 94ba5a8e80..bc3d1d2803 100644 --- a/src/libvirt-host.c +++ b/src/libvirt-host.c @@ -399,6 +399,22 @@ virConnectGetMaxVcpus(virConnectPtr conn, * * Extract hardware information about the node. * + * Use of this API is strongly discouraged as the information provided + * is not guaranteed to be accurate on all hardware platforms. + * + * The mHZ value merely reflects the speed that the first CPU in the + * machine is currently running at. This speed may vary across CPUs + * and changes continually as the host OS throttles. + * + * The nodes/sockets/cores/threads data is potentially inaccurate as + * it assumes a symmetric installation. If one NUMA node has more + * sockets populated that another NUMA node this information will be + * wrong. It is also not able to report about CPU dies. + * + * Applications are recommended to use the virConnectGetCapabilities() + * call instead, which provides all the information except CPU mHZ, + * in a more accurate representation. + * * Returns 0 in case of success and -1 in case of failure. */ int --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list