diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 0ca53e438e..4c50155e10 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -707,13 +707,16 @@ cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd) goto cleanup; } - if (ninterfaces != 1) { + if (ninterfaces < 1) { if (macstr[0]) vshError(ctl, _("Interface (mac: %s) not found."), macstr); else vshError(ctl, _("Interface (dev: %s) not found."), iface); goto cleanup; + } else if (ninterfaces > 1) { + vshError(ctl, _("multiple matching interfaces found")); + goto cleanup; } ctxt->node = interfaces[0];