On Tue, Mar 04, 2025 at 14:04:09 +0000, Daniel P. Berrangé wrote:
> 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.
> 
> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
> ---
>  include/libvirt/libvirt-domain.h | 224 +++++++++++++++++++++++++++++++
>  src/libvirt-domain.c             |  68 +---------
>  src/qemu/qemu_driver.c           |  35 ++++-
>  3 files changed, 260 insertions(+), 67 deletions(-)

Reviewed-by: Peter Krempa <pkre...@redhat.com>

Reply via email to