From nobody Thu May 15 07:28:18 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; dkim=fail; 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 1517215041026145.34106460724445; Mon, 29 Jan 2018 00:37:21 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90C9D25778; Mon, 29 Jan 2018 08:37:19 +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 63A085D9CD; Mon, 29 Jan 2018 08:37:19 +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 224DE18033DD; Mon, 29 Jan 2018 08:37:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0T8Zr79012955 for ; Mon, 29 Jan 2018 03:35:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 925CC6EE7B; Mon, 29 Jan 2018 08:35:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C8376EE79 for ; Mon, 29 Jan 2018 08:35:51 +0000 (UTC) Received: from m15-114.126.com (m15-114.126.com [220.181.15.114]) by mx1.redhat.com (Postfix) with ESMTP id 288574903F for ; Mon, 29 Jan 2018 08:35:49 +0000 (UTC) Received: from localhost.localdomain (unknown [58.213.111.46]) by smtp7 (Coremail) with SMTP id DsmowAB3v8rY3G5aWHXEBQ--.13603S5; Mon, 29 Jan 2018 16:35:46 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=Tox3HTIatJomzawNCE SJCC17DqjI3Gg+/npueR+hGa0=; b=FVoUeZLnsflw+tiXXmAIokTkAw1U0Yd2tU iK64jjFlAW5VJLmNqnZ3+zHBjqYNFGrRnt28UZ+tkaVpVA5qmlgRWX8Pulg/fEvP U2gHqubqM2QW9z2bhg7fu0V/t6tjiqpo2jj8SrSR1CU7h6xaDj8aM8k1k+1BVAEG RduTMKerM= From: Chen Hanxiao To: libvir-list@redhat.com Date: Mon, 29 Jan 2018 16:35:35 +0800 Message-Id: <20180129083536.24554-4-chen_han_xiao@126.com> In-Reply-To: <20180129083536.24554-1-chen_han_xiao@126.com> References: <20180129083536.24554-1-chen_han_xiao@126.com> X-CM-TRANSID: DsmowAB3v8rY3G5aWHXEBQ--.13603S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7Kr1kAr13JFWfAw1ktw48tFb_yoW8ur4kpF s3Xay7A3s7Xrn8X3Z5Cw15uFykG3y29r18uan8Xw1jvr45A3WDJr17GFWF9Fn7Cr10v3W0 yrZF9F4DZFs5AF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j3nY7UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbiEwLcrlpD4FGCQAABsI X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Jan 2018 08:35:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Jan 2018 08:35:51 +0000 (UTC) for IP:'220.181.15.114' DOMAIN:'m15-114.126.com' HELO:'m15-114.126.com' FROM:'chen_han_xiao@126.com' RCPT:'' X-RedHat-Spam-Score: 1.99 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_PSBL, SPF_PASS, T_RP_MATCHES_RCVD) 220.181.15.114 m15-114.126.com 220.181.15.114 m15-114.126.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Chen Hanxiao Subject: [libvirt] [PATCH v3 3/4] virsh: add --source arp to domifaddr 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Jan 2018 08:37:20 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Chen Hanxiao We can use: domifaddr f26-cloud --source arp to get the address. Acked-by: Michal Privoznik Signed-off-by: Chen Hanxiao --- tools/virsh-domain-monitor.c | 2 ++ tools/virsh.pod | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 32a42707e..68da11ed5 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -2190,6 +2190,8 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd) source =3D VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE; } else if (STREQ(sourcestr, "agent")) { source =3D VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT; + } else if (STREQ(sourcestr, "arp")) { + source =3D VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP; } else { vshError(ctl, _("Unknown data source '%s'"), sourcestr); goto cleanup; diff --git a/tools/virsh.pod b/tools/virsh.pod index 69cc42338..1dfe2a9b0 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -759,7 +759,7 @@ B (fields appear in the followin= g order): =20 =20 =3Ditem B I [I] [I<--full>] - [I<--source lease|agent>] + [I<--source lease|agent|arp>] =20 Get a list of interfaces of a running domain along with their IP and MAC addresses, or limited output just for one interface if I is @@ -774,8 +774,9 @@ only the interface name and MAC address is displayed fo= r the first name and MAC address with "-" for the others using the same name and MAC address. =20 The I<--source> argument specifies what data source to use for the -addresses, currently one of 'lease' to read DHCP leases, or 'agent' to que= ry -the guest OS via an agent. If unspecified, 'lease' is the default. +addresses, currently 'lease' to read DHCP leases, 'agent' to query +the guest OS via an agent, or 'arp' to get IP from host's arp tables. +If unspecified, 'lease' is the default. =20 =3Ditem B I I =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list