src: add constant for the guest info 'hostname' parameter

Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info 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 guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2025-03-12 09:58:16 +00:00
parent e7a122a192
commit 941d11fe71
3 changed files with 17 additions and 7 deletions
+10
View File
@@ -6620,6 +6620,16 @@ int virDomainSetLaunchSecurityState(virDomainPtr domain,
*/
# define VIR_DOMAIN_GUEST_INFO_TIMEZONE_OFFSET "timezone.offset"
/**
* VIR_DOMAIN_GUEST_INFO_HOSTNAME_HOSTNAME:
*
* The hostname of the domain as a string.
*
* Since: 11.2.0
*/
# define VIR_DOMAIN_GUEST_INFO_HOSTNAME_HOSTNAME "hostname"
/**
* virDomainGuestInfoTypes:
*