From: zhanglei Date: Fri, 15 Oct 2021 10:07:47 +0000 (+0800) Subject: domain: add interface information to 'virDomainGetGuestInfo' X-Git-Tag: v7.10.0-rc1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=348758b1b55d0063c413de02df825e22b62f6e4f;p=thirdparty%2Flibvirt.git domain: add interface information to 'virDomainGetGuestInfo' Signed-off-by: zhanglei Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index eaafcc6b29..2f017c5b68 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -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, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 57baef6889..ce7cafde36 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -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..name" - name in the guest (e.g. ``eth0``) for interface + * "if..hwaddr" - hardware address in the guest for interface + * "if..addr.count - the number of IP addresses of interface + * "if..addr..type" - the IP address type of addr (e.g. ipv4) + * "if..addr..addr" - the IP address of addr + * "if..addr..prefix" - the prefix of IP address of addr + * * Using 0 for @types returns all information groups supported by the given * hypervisor. *