Signed-off-by: Lin Ma <lma(a)suse.com>
---
src/libvirt-domain.c | 2 ++
src/qemu/qemu_driver.c | 4 ++++
tools/virsh.pod | 2 ++
3 files changed, 8 insertions(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 2d86e48979..e317ca00d0 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -11310,6 +11310,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
* "net.count" - number of network interfaces on this domain
* as unsigned int.
* "net.<num>.name" - name of the interface <num> as string.
+ * "net.<num>.type" - type of the interface <num> as string.
+ * "net.<num>.source" - source of the interface <num> as
string.
* "net.<num>.rx.bytes" - bytes received as unsigned long long.
* "net.<num>.rx.pkts" - packets received as unsigned long long.
* "net.<num>.rx.errs" - receive errors as unsigned long long.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 83fc191085..7a9a2bcf97 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19823,6 +19823,10 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver
ATTRIBUTE_UNUSED,
QEMU_ADD_NAME_PARAM(record, maxparams,
"net", "name", i, net->ifname);
+ QEMU_ADD_NAME_PARAM(record, maxparams,
+ "net", "type", i,
virDomainNetTypeToString(net->type));
+ QEMU_ADD_NAME_PARAM(record, maxparams,
+ "net", "source", i,
net->data.bridge.brname);
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virNetDevOpenvswitchInterfaceStats(net->ifname, &tmp) < 0) {
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 929958a953..7ec57c0b4b 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -974,6 +974,8 @@ I<--interface> returns:
"net.count" - number of network interfaces on this domain
"net.<num>.name" - name of the interface <num>
+ "net.<num>.type" - type of the interface <num>
+ "net.<num>.source" - source of the interface <num>
"net.<num>.rx.bytes" - number of bytes received
"net.<num>.rx.pkts" - number of packets received
"net.<num>.rx.errs" - number of receive errors
--
2.15.1