From nobody Fri May 16 08:29:07 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.zoho.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 1496850108547572.6129856705002; Wed, 7 Jun 2017 08:41:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F61E1766BA; Wed, 7 Jun 2017 15:41:42 +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 3B8DB7DFFB; Wed, 7 Jun 2017 15:41:41 +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 2CA63180BAFA; Wed, 7 Jun 2017 15:41:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v57FfZOH029868 for ; Wed, 7 Jun 2017 11:41:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3E5617114; Wed, 7 Jun 2017 15:41:34 +0000 (UTC) Received: from moe.brq.redhat.com (dhcp129-131.brq.redhat.com [10.34.129.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E0EF7DFE8 for ; Wed, 7 Jun 2017 15:41:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9F61E1766BA Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9F61E1766BA From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 7 Jun 2017 17:41:29 +0200 Message-Id: <1a3571c3f36e4a40ab7fd8a995581fc4a1cc447d.1496850012.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] virsh: Accept iface alias for domifstats too 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 07 Jun 2017 15:41:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1459091 Not every interface has a name (for instance, vhostuser interfaces might not have one). However, all interfaces have aliases. We can accept those to uniquely identify interfaces. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 6 ++++-- tools/virsh-domain-monitor.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f0cdea659..0634d9e5a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10753,8 +10753,10 @@ qemuDomainInterfaceStats(virDomainPtr dom, =20 /* Check the path is one of the domain's network interfaces. */ for (i =3D 0; i < vm->def->nnets; i++) { - if (STREQ_NULLABLE(vm->def->nets[i]->ifname, path)) { - net =3D vm->def->nets[i]; + virDomainNetDefPtr tmp =3D vm->def->nets[i]; + if (STREQ_NULLABLE(tmp->ifname, path) || + STREQ(tmp->info.alias, path)) { + net =3D tmp; break; } } diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 0ca53e438..313a6d2f0 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -614,7 +614,8 @@ cmdDomiflist(vshControl *ctl, const vshCmd *cmd) "|./source/@network" "|./source/@name)", ctxt); =20 - target =3D virXPathString("string(./target/@dev)", ctxt); + target =3D virXPathString("string(./target/@dev" + "|./alias/@name)", ctxt); model =3D virXPathString("string(./model/@type)", ctxt); mac =3D virXPathString("string(./mac/@address)", ctxt); =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list