]> xenbits.xensource.com Git - libvirt.git/commitdiff
virerror: Introduce new error type NO_SERVER
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 8 Mar 2016 16:22:46 +0000 (17:22 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 11 Mar 2016 11:58:41 +0000 (12:58 +0100)
This serves the same purpose as VIR_ERR_NO_xxx where xxx is any object
that API can be called upon.  Only this particular one is used for
daemon's servers.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
include/libvirt/virterror.h
src/util/virerror.c

index 83f76d84cbbca0e5c3dca9b211bab6b984ce857c..1f0702b5890a8b69c30b13a60c86e9557ac0b1a4 100644 (file)
@@ -311,6 +311,7 @@ typedef enum {
     VIR_ERR_XML_INVALID_SCHEMA = 92,    /* XML document doesn't validate against schema */
     VIR_ERR_MIGRATE_FINISH_OK = 93,     /* Finish API succeeded but it is expected to return NULL */
     VIR_ERR_AUTH_UNAVAILABLE = 94,     /* authentication unavailable */
+    VIR_ERR_NO_SERVER = 95,             /* Server was not found */
 } virErrorNumber;
 
 /**
index 377c2b11a2c292f84674b2e5b9652a233d161a67..61b9ea0160325060f199f6aa9723d99cbda2e338 100644 (file)
@@ -1380,6 +1380,12 @@ virErrorMsg(virErrorNumber error, const char *info)
         case VIR_ERR_MIGRATE_FINISH_OK:
             errmsg = _("migration successfully aborted");
             break;
+        case VIR_ERR_NO_SERVER:
+            if (info == NULL)
+                errmsg = _("Server not found");
+            else
+                errmsg = _("Server not found: %s");
+            break;
     }
     return errmsg;
 }