]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain: add interface information to 'virDomainGetGuestInfo'
authorzhanglei <zhanglei@smartx.com>
Fri, 15 Oct 2021 10:07:47 +0000 (18:07 +0800)
committerJán Tomko <jtomko@redhat.com>
Fri, 5 Nov 2021 12:38:40 +0000 (13:38 +0100)
Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
include/libvirt/libvirt-domain.h
src/libvirt-domain.c

index eaafcc6b29fe763ea6b8fcda57b8d2980debeac9..2f017c5b68eaf0b82c5afba41f705315a79a35a5 100644 (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,
index 57baef6889f2991607973c960a93280b413663e5..ce7cafde3670877256126692a9d92c100babe659 100644 (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.
  *