From 6eeca586d4c8441753edb68a3458aba285743962 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Tue, 21 Jul 2009 15:13:32 +0200 Subject: [PATCH] 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. --- include/libvirt/virterror.h | 1 + src/virterror.c | 6 ++++++ 2 files changed, 7 insertions(+) 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); }