]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: Adapt to new HW address scenario
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 17 Mar 2015 16:28:53 +0000 (17:28 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 18 Mar 2015 08:12:52 +0000 (09:12 +0100)
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@redhat.com>
tools/virsh-domain-monitor.c

index c9bf156d8ecaf463396ffea1c70b3298cff978bd..07170760774cdc6b4258f3e8d38055d68b3b14cf 100644 (file)
@@ -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);