From: Laine Stump Date: Tue, 21 Jul 2009 13:13:32 +0000 (+0200) Subject: Add an error code for conflicting mac addresses X-Git-Tag: v0.7.0~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eeca586d4c8441753edb68a3458aba285743962;p=thirdparty%2Flibvirt.git 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. --- diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 109289663d..f587fbfaa3 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -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; /** diff --git a/src/virterror.c b/src/virterror.c index d284fb823a..7d0f2e98b6 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -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); }