]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: error: Add error message versions with info for some error codes
authorPeter Krempa <pkrempa@redhat.com>
Mon, 12 Nov 2018 15:00:03 +0000 (16:00 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Dec 2018 12:28:43 +0000 (13:28 +0100)
Few error codes were missing the version of the message with additional
info. In case of the modified messages it's not very likely they'll ever
report any additional data, but for the sake of consistency we should
provide them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/util/virerror.c

index ce0679b23e6b47e3fce7467fee47a2bd792cec1f..a32a1fbd4125ceb7f7beb5089da46ae771661f5e 100644 (file)
@@ -924,7 +924,10 @@ virErrorMsg(virErrorNumber error, const char *info)
               errmsg = _("internal error");
             break;
         case VIR_ERR_NO_MEMORY:
-            errmsg = _("out of memory");
+            if (info == NULL)
+                errmsg = _("out of memory");
+            else
+                errmsg = _("out of memory: %s");
             break;
         case VIR_ERR_NO_SUPPORT:
             if (info == NULL)
@@ -1017,7 +1020,10 @@ virErrorMsg(virErrorNumber error, const char *info)
                 errmsg = _("unknown OS type %s");
             break;
         case VIR_ERR_NO_KERNEL:
-            errmsg = _("missing kernel information");
+            if (info == NULL)
+                errmsg = _("missing kernel information");
+            else
+                errmsg = _("missing kernel information: %s");
             break;
         case VIR_ERR_NO_ROOT:
             if (info == NULL)
@@ -1470,7 +1476,10 @@ virErrorMsg(virErrorNumber error, const char *info)
                 errmsg = _("XML document failed to validate against schema: %s");
             break;
         case VIR_ERR_MIGRATE_FINISH_OK:
-            errmsg = _("migration successfully aborted");
+            if (info == NULL)
+                errmsg = _("migration successfully aborted");
+            else
+                errmsg = _("migration successfully aborted: %s");
             break;
         case VIR_ERR_NO_SERVER:
             if (info == NULL)