]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: warn against virNodeGetInfo() API call due to inaccurate info
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Dec 2019 10:35:50 +0000 (10:35 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 18 Dec 2019 11:57:18 +0000 (11:57 +0000)
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/libvirt/libvirt-host.h
src/libvirt-host.c

index be65b4686baedad1954d58a8b180e22da49597b5..b87d634813cdf0f8d17e13531100cc2e384819e8 100644 (file)
@@ -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.
  */
 
 typedef struct _virNodeInfo virNodeInfo;
index 94ba5a8e80f54a773c750bc6055bc9e68a1c2aae..bc3d1d2803fe43acdd01b17fc3573fe925718418 100644 (file)
@@ -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