提交 50780207 编写于 作者: M Michal Privoznik

virsh: Adapt to new HW address scenario

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: NMichal Privoznik <mprivozn@redhat.com>
上级 3640245d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册