]> git.ipfire.org Git - thirdparty/libvirt.git/commit
src: add constants for domain stats 'dirtyrate.' 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:01:06 +0000 (10:01 +0000)
commit5d9f73628bcf2fb457101a5decb57e69afa45b0b
treee74aa525c24b8877111a8ae53ab26facf68e2ee3
parentb1c0ec1767a32905ac6fe9972279a3d1b8c0c1d9
src: add constants for domain stats 'dirtyrate.' 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