[libvirt] [PATCH 2/5] virsh: Adapt to new HW address scenario

Daniel P. Berrange berrange at redhat.com
Tue Mar 17 17:19:11 UTC 2015


On Tue, Mar 17, 2015 at 05:52:54PM +0100, Michal Privoznik wrote:
> Make sure we don't print (null) (which in fact is printf()'s
> cleverness anyway, not ours). If no HW address is present, print
> "N/A" string just like we do for other fields.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  tools/virsh-domain-monitor.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> index c9bf156..0717076 100644
> --- a/tools/virsh-domain-monitor.c
> +++ b/tools/virsh-domain-monitor.c
> @@ -2278,7 +2278,8 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
>          /* When the interface has no IP address */
>          if (!iface->naddrs) {
>              vshPrintExtra(ctl, " %-10s %-17s    %-12s %s\n",
> -                          iface->name, iface->hwaddr, "N/A", "N/A");
> +                          iface->name,
> +                          iface->hwaddr ? iface->hwaddr : "N/A", "N/A", "N/A");
>              continue;
>          }
>  
> @@ -2312,7 +2313,8 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
>              /* Don't repeat interface name */
>              if (full || !j)
>                  vshPrintExtra(ctl, " %-10s %-17s    %s\n",
> -                              iface->name, iface->hwaddr, ip_addr_str);
> +                              iface->name,
> +                              iface->hwaddr ? iface->hwaddr : "", ip_addr_str);
>              else
>                  vshPrintExtra(ctl, " %-10s %-17s    %s\n",
>                                "-", "-", ip_addr_str);

ACK

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list