[libvirt] [PATCH 2/9] api: Allow keeping completed domain job stats when reading them
Eric Blake
eblake at redhat.com
Tue Nov 26 16:23:27 UTC 2019
On 11/25/19 9:01 AM, Peter Krempa wrote:
> virDomainGetJobStats destroys the completed statistics on the first
> read. Give the user possibility to keep them around if they wish so.
>
> Add a flag VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP which will read the stats
> without destroying them.
>
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
> include/libvirt/libvirt-domain.h | 2 ++
> src/libvirt-domain.c | 6 +++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index a2f007568c..84b3cfdff7 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -3246,6 +3246,8 @@ struct _virDomainJobInfo {
> typedef enum {
> VIR_DOMAIN_JOB_STATS_COMPLETED = 1 << 0, /* return stats of a recently
> * completed job */
> + VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP = 1 << 1, /* don't remove completed
> + stats when reading them */
Bike-shedding - STATS_KEEP_COMPLETED sounds like a better naming to me.
A renaming has ripple effects, but that's my only complaint, so
whichever name you go with:
Reviewed-by: Eric Blake <eblake at redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
More information about the libvir-list
mailing list