Re: [libvirt] [PATCH 6/7] qemu: stats: Display the net type and net source in bulk stats

2018-05-07 Thread Lin Ma



On 05/04/2018 06:10 PM, Peter Krempa wrote:

On Fri, May 04, 2018 at 17:28:53 +0800, Lin Ma wrote:

Signed-off-by: Lin Ma 
---

Could you justify this? This is really configuration and will not change
during the lifetime of the interface, thus there's no pressing need to
report it in the stats which should report only data which is changing.

well, Actually there is nothing special usecase, Just want to provide 
more corresponding
information in a single command to users, Please forget it if it doesn't 
make sense.


Thanks,
Lin
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 6/7] qemu: stats: Display the net type and net source in bulk stats

2018-05-04 Thread Peter Krempa
On Fri, May 04, 2018 at 17:28:53 +0800, Lin Ma wrote:
> Signed-off-by: Lin Ma 
> ---

Could you justify this? This is really configuration and will not change
during the lifetime of the interface, thus there's no pressing need to
report it in the stats which should report only data which is changing.


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 6/7] qemu: stats: Display the net type and net source in bulk stats

2018-05-04 Thread Lin Ma
Signed-off-by: Lin Ma 
---
 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..name" - name of the interface  as string.
+ * "net..type" - type of the interface  as string.
+ * "net..source" - source of the interface  as string.
  * "net..rx.bytes" - bytes received as unsigned long long.
  * "net..rx.pkts" - packets received as unsigned long long.
  * "net..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, ) < 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..name" - name of the interface 
+ "net..type" - type of the interface 
+ "net..source" - source of the interface 
  "net..rx.bytes" - number of bytes received
  "net..rx.pkts" - number of packets received
  "net..rx.errs" - number of receive errors
-- 
2.15.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list