]> git.ipfire.org Git - thirdparty/libvirt.git/commit
src: add constants for domain stats 'block.' parameters
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 27 Feb 2025 13:42:08 +0000 (13:42 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 12 Mar 2025 10:00:24 +0000 (10:00 +0000)
commit4661ceb067dc46d700e8473c3a306f8bd199a627
tree5cdb2f8e5d24dea61b8ab6985b0b8514d78b42bb
parent88bae83ea97dc6b91ed2d70940d0cdfede44c0bf
src: add constants for domain stats 'block.' parameters

Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/libvirt/libvirt-domain.h
src/libvirt-domain.c
src/qemu/qemu_driver.c