Add an error code for conflicting mac addresses

* include/libvirt/virterror.h src/virterror.c: if a driver's
  virInterfaceLookupByMACString() function finds more than one interface
  with the desired MAC Address, this new error is raised.
This commit is contained in:
Laine Stump 2009-07-21 15:13:32 +02:00 committed by Daniel Veillard
parent b2fd033cd5
commit 6eeca586d4
2 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,7 @@ typedef enum {
VIR_WAR_NO_INTERFACE, /* failed to start interface driver */
VIR_ERR_NO_INTERFACE, /* interface driver not running */
VIR_ERR_INVALID_INTERFACE, /* invalid interface object */
VIR_ERR_MULTIPLE_INTERFACES, /* more than one matching interface found */
} virErrorNumber;
/**

View File

@ -1056,6 +1056,12 @@ virErrorMsg(virErrorNumber error, const char *info)
else
errmsg = _("invalid interface pointer in %s");
break;
case VIR_ERR_MULTIPLE_INTERFACES:
if (info == NULL)
errmsg = _("multiple matching interfaces found");
else
errmsg = _("multiple matching interfaces found: %s");
break;
}
return (errmsg);
}