[libvirt] [PATCH v3 3/4] virsh: add --source arp to domifaddr

Chen Hanxiao chen_han_xiao at 126.com
Mon Jan 29 08:35:35 UTC 2018

From: Chen Hanxiao <chenhanxiao at gmail.com>

We can use:
  domifaddr f26-cloud --source arp
to get the address.

Acked-by: Michal Privoznik <mprivozn at redhat.com>
Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
 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)
         } else if (STREQ(sourcestr, "agent")) {
+        } else if (STREQ(sourcestr, "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<Explanation of fields> (fields appear in the following order):
 =item B<domifaddr> I<domain> [I<interface>] [I<--full>]
-              [I<--source lease|agent>]
+              [I<--source lease|agent|arp>]
 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<interface> is
@@ -774,8 +774,9 @@ only the interface name and MAC address is displayed for the first name and
 MAC address with "-" for the others using the same name and MAC address.
 The I<--source> argument specifies what data source to use for the
-addresses, currently one of 'lease' to read DHCP leases, or 'agent' to query
-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.
 =item B<domifstat> I<domain> I<interface-device>

More information about the libvir-list mailing list