[PATCH 16/16] Improve error message when XDR marshalling fails

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

 



When failing to marshall an XDR message, include the
full program/version/status/proc/type info, to allow
easier debugging & diagnosis of the problem.

* src/remote/remote_driver.c: Improve error when marshalling
  fails
---
 src/remote/remote_driver.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index e113e39..9afa180 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -5365,7 +5365,9 @@ prepareCall(struct private_data *priv,
     }
 
     if (!(*args_filter) (&xdr, args)) {
-        remoteError(VIR_ERR_RPC, "%s", _("marshalling args"));
+        remoteError(VIR_ERR_RPC,
+                    _("Unable to marshall arguments for program %d version %d procedure %d type %d status %d"),
+                    hdr.prog, hdr.vers, hdr.proc, hdr.type, hdr.status);
         goto error;
     }
 
@@ -5821,7 +5823,9 @@ processCallDispatchReply(virConnectPtr conn ATTRIBUTE_UNUSED,
     switch (hdr->status) {
     case REMOTE_OK:
         if (!(*thecall->ret_filter) (xdr, thecall->ret)) {
-            remoteError(VIR_ERR_RPC, "%s", _("unmarshalling ret"));
+            remoteError(VIR_ERR_RPC,
+                        _("Unable to marshall reply for program %d version %d procedure %d type %d status %d"),
+                        hdr->prog, hdr->vers, hdr->proc, hdr->type, hdr->status);
             return -1;
         }
         thecall->mode = REMOTE_MODE_COMPLETE;
@@ -5830,7 +5834,9 @@ processCallDispatchReply(virConnectPtr conn ATTRIBUTE_UNUSED,
     case REMOTE_ERROR:
         memset (&thecall->err, 0, sizeof thecall->err);
         if (!xdr_remote_error (xdr, &thecall->err)) {
-            remoteError(VIR_ERR_RPC, "%s", _("unmarshalling remote_error"));
+            remoteError(VIR_ERR_RPC,
+                        _("Unable to marshall error for program %d version %d procedure %d type %d status %d"),
+                        hdr->prog, hdr->vers, hdr->proc, hdr->type, hdr->status);
             return -1;
         }
         thecall->mode = REMOTE_MODE_ERROR;
-- 
1.7.4.4

--
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]