domain: add interface information to 'virDomainGetGuestInfo'

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
zhanglei 2021-10-15 18:07:47 +08:00 committed by Ján Tomko
parent c43f22d5c1
commit 348758b1b5
2 changed files with 13 additions and 0 deletions

View File

@ -5098,6 +5098,7 @@ typedef enum {
VIR_DOMAIN_GUEST_INFO_HOSTNAME = (1 << 3), /* return hostname information */
VIR_DOMAIN_GUEST_INFO_FILESYSTEM = (1 << 4), /* return filesystem information */
VIR_DOMAIN_GUEST_INFO_DISKS = (1 << 5), /* return disks information */
VIR_DOMAIN_GUEST_INFO_INTERFACES = (1 << 6), /* return interfaces information */
} virDomainGuestInfoTypes;
int virDomainGetGuestInfo(virDomainPtr domain,

View File

@ -12579,6 +12579,18 @@ virDomainSetVcpu(virDomainPtr domain,
*
* "hostname" - the hostname of the domain
*
* VIR_DOMAIN_GUEST_INFO_INTERFACES:
* Returns information about the interfaces within the domain. The typed
* parameter keys are in this format:
*
* "if.count" - the number of interfaces defined on this domain
* "if.<num>.name" - name in the guest (e.g. ``eth0``) for interface <num>
* "if.<num>.hwaddr" - hardware address in the guest for interface <num>
* "if.<num>.addr.count - the number of IP addresses of interface <num>
* "if.<num>.addr.<num1>.type" - the IP address type of addr <num1> (e.g. ipv4)
* "if.<num>.addr.<num1>.addr" - the IP address of addr <num1>
* "if.<num>.addr.<num1>.prefix" - the prefix of IP address of addr <num1>
*
* Using 0 for @types returns all information groups supported by the given
* hypervisor.
*