From a421aa76b1b74d6b307b273f902bd929989ab6e5 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 28 Nov 2022 17:09:23 +0100 Subject: [PATCH] Document caveats of hypervisor-specific stats in 'VIR_DOMAIN_STATS_VCPU' group In commit c43718ef67944 I've added a disclaimer that the new stats which are fetched from qemu and passed directly to the user are not guaranteed by libvirt. I didn't notice that per-vcpu hypervisor specific stats are also snuck into the VIR_DOMAIN_STATS_VCPU group along with other pre-existing stats we do guarantee. Extend the disclaimer for VIR_DOMAIN_STATS_VCPU too. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- docs/manpages/virsh.rst | 22 ++++++++++++++++++++++ src/libvirt-domain.c | 17 +++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5f5f48f83e..1e8a43bc55 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2399,6 +2399,28 @@ When selecting the *--state* group the following fields are returned: host scheduler, but was waiting in the queue instead of running. Exposed to the VM as a steal time. +This group of statistics also reports additional hypervisor-originating per-vCPU +stats. The hypervisor-specific statistics in this group have the following +naming scheme: + + ``vcpu..$NAME.$TYPE`` + + ``$NAME`` + name of the statistics field provided by the hypervisor + + ``$TYPE`` + Type of the value. The following types are returned: + + ``cur`` + current instant value + ``sum`` + aggregate value + ``max`` + peak value + + The returned value may be either an unsigned long long or a boolean. Meaning + is hypervisor specific. Please see the disclaimer for the *--vm* group which + also consists of hypervisor-specific stats. *--interface* returns: diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 56c2abf3fa..78c26b2219 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12270,6 +12270,23 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * instead of running. Exposed to the VM as a steal * time. * + * This group of statistics also reports additional hypervisor-originating + * per-vCPU stats. The hypervisor-specific statistics in this group have the + * following naming scheme: + * + * "vcpu..$NAME.$TYPE" + * + * $NAME - name of the statistics field provided by the hypervisor + * + * $TYPE - Type of the value. The following types are returned: + * 'cur' - current instant value + * 'sum' - aggregate value + * 'max' - peak value + * + * The returned value may be either an unsigned long long or a boolean. + * Meaning is hypervisor specific. Please see the disclaimer for the + * VIR_DOMAIN_STATS_VM group below. + * * VIR_DOMAIN_STATS_INTERFACE: * Return network interface statistics (from domain point of view). * The typed parameter keys are in this format: