]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add an error code for conflicting mac addresses
authorLaine Stump <laine@laine.org>
Tue, 21 Jul 2009 13:13:32 +0000 (15:13 +0200)
committerDaniel Veillard <veillard@redhat.com>
Tue, 21 Jul 2009 13:13:32 +0000 (15:13 +0200)
* 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
src/virterror.c

index 109289663d6bc289baec6cfc306c8346f675479c..f587fbfaa3cad119f85a1498d4c8f67a7466aa1b 100644 (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;
 
 /**
index d284fb823a71909fd91ef213b45142645605c746..7d0f2e98b6fc7e662617961d09916d2af783a3e0 100644 (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);
 }