[PATCH 5/5] virdbus: Show method name in error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you trigger bug 1033369, we get the error message:

  error from service: Invalid argument

Which is a bit too generic to pinpoint what is actually failing. This
changes it to:

  error from service: CreateMachine: Invalid argument
---
 src/util/virdbus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index 03ec028..31251fe 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -1408,7 +1408,8 @@ static int
 virDBusCall(DBusConnection *conn,
             DBusMessage *call,
             DBusMessage **replyout,
-            DBusError *error)
+            DBusError *error,
+            const char *member)
 {
     DBusMessage *reply = NULL;
     DBusError localerror;
@@ -1424,7 +1425,7 @@ virDBusCall(DBusConnection *conn,
         if (error)
             ret = 0;
         else {
-            virReportError(VIR_ERR_DBUS_SERVICE, "%s",
+            virReportError(VIR_ERR_DBUS_SERVICE, _("%s: %s"), member,
                 localerror.message ? localerror.message : _("unknown error"));
         }
         goto cleanup;
@@ -1502,7 +1503,7 @@ int virDBusCallMethod(DBusConnection *conn,
 
     ret = -1;
 
-    ret = virDBusCall(conn, call, replyout, error);
+    ret = virDBusCall(conn, call, replyout, error, member);
 
  cleanup:
     if (call)
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]