9119d9
From 1f5ab1ab07d8e2ddf08dec964c401c49cc5d32c9 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <1f5ab1ab07d8e2ddf08dec964c401c49cc5d32c9@dist-git>
9119d9
From: Eric Blake <eblake@redhat.com>
9119d9
Date: Wed, 17 Dec 2014 03:09:00 -0700
9119d9
Subject: [PATCH] getstats: improve documentation
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1041569
9119d9
9119d9
At least with 'virsh domstats --block' on an offline domain, we
9119d9
currently output no stats even though we recognize the stat
9119d9
category.  Although a later patch will improve this situation,
9119d9
it is better to document that this is expected behavior.
9119d9
9119d9
Also, while the current implementation rejects filtering flags
9119d9
for virDomainListGetStats, this limitation may be lifted in the
9119d9
future and we do not enforce it at the API level.
9119d9
9119d9
* src/libvirt-domain.c (virConnectGetAllDomainStats): Document
9119d9
that recognized stats might not be reported.
9119d9
(virDomainListGetStats): Likewise, and tweak filtering documentation.
9119d9
9119d9
Signed-off-by: Eric Blake <eblake@redhat.com>
9119d9
(cherry picked from commit f301fe77c63b29b90ad478e328fb20394251f6a6)
9119d9
9119d9
Conflicts:
9119d9
	src/libvirt-domain.c - file split from libvirt.c
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/libvirt.c | 14 +++++++++++---
9119d9
 1 file changed, 11 insertions(+), 3 deletions(-)
9119d9
9119d9
diff --git a/src/libvirt.c b/src/libvirt.c
9119d9
index b593c9b..1097693 100644
9119d9
--- a/src/libvirt.c
9119d9
+++ b/src/libvirt.c
9119d9
@@ -21633,7 +21633,11 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
9119d9
  *
9119d9
  * Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as @flags makes
9119d9
  * the function return error in case some of the stat types in @stats were
9119d9
- * not recognized by the daemon.
9119d9
+ * not recognized by the daemon.  However, even with this flag, a hypervisor
9119d9
+ * may omit individual fields within a known group if the information is not
9119d9
+ * available; as an extreme example, a supported group may produce zero
9119d9
+ * fields for offline domains if the statistics are meaningful only for a
9119d9
+ * running domain.
9119d9
  *
9119d9
  * Similarly to virConnectListAllDomains, @flags can contain various flags to
9119d9
  * filter the list of domains to provide stats for.
9119d9
@@ -21713,9 +21717,13 @@ virConnectGetAllDomainStats(virConnectPtr conn,
9119d9
  *
9119d9
  * Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as @flags makes
9119d9
  * the function return error in case some of the stat types in @stats were
9119d9
- * not recognized by the daemon.
9119d9
+ * not recognized by the daemon.  However, even with this flag, a hypervisor
9119d9
+ * may omit individual fields within a known group if the information is not
9119d9
+ * available; as an extreme example, a supported group may produce zero
9119d9
+ * fields for offline domains if the statistics are meaningful only for a
9119d9
+ * running domain.
9119d9
  *
9119d9
- * Note that any of the domain list filtering flags in @flags will be rejected
9119d9
+ * Note that any of the domain list filtering flags in @flags may be rejected
9119d9
  * by this function.
9119d9
  *
9119d9
  * Returns the count of returned statistics structures on success, -1 on error.
9119d9
-- 
9119d9
2.2.0
9119d9