From nobody Wed May 14 23:52:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1525426826567819.2904468912161; Fri, 4 May 2018 02:40:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 641F430F8D85; Fri, 4 May 2018 09:40:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15EE1271A9; Fri, 4 May 2018 09:40:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7357A180BADA; Fri, 4 May 2018 09:40:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w449VtKq004843 for ; Fri, 4 May 2018 05:31:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 32F539CB9E; Fri, 4 May 2018 09:31:55 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28F349C404 for ; Fri, 4 May 2018 09:31:52 +0000 (UTC) Received: from prv3-mh.provo.novell.com (victor.provo.novell.com [137.65.250.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45D753133E7A for ; Fri, 4 May 2018 09:31:46 +0000 (UTC) Received: from localhost.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Fri, 04 May 2018 03:31:37 -0600 From: Lin Ma To: libvir-list@redhat.com Date: Fri, 4 May 2018 17:28:53 +0800 Message-Id: <20180504092854.3851-7-lma@suse.com> In-Reply-To: <20180504092854.3851-1-lma@suse.com> References: <20180504092854.3851-1-lma@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 04 May 2018 09:31:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 04 May 2018 09:31:51 +0000 (UTC) for IP:'137.65.250.26' DOMAIN:'victor.provo.novell.com' HELO:'prv3-mh.provo.novell.com' FROM:'lma@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.26 victor.provo.novell.com 137.65.250.26 victor.provo.novell.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemu: stats: Display the net type and net source in bulk stats X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 04 May 2018 09:40:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 drive= r ATTRIBUTE_UNUSED, =20 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); =20 if (actualType =3D=3D 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: =20 "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 --=20 2.15.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list