[PATCH 5/9] Improve two log messages in virNetMessage

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

 



Improve log messages issued when encountering a bogus
message length to include the actual length and the
limit violated

* src/rpc/virnetmessage.c: Improve log messages
---
 src/rpc/virnetmessage.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index a7a25b1..0725491 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -101,8 +101,9 @@ int virNetMessageDecodeLength(virNetMessagePtr msg)
     msg->bufferOffset = xdr_getpos(&xdr);
 
     if (len < VIR_NET_MESSAGE_LEN_MAX) {
-        virNetError(VIR_ERR_RPC, "%s",
-                    _("packet received from server too small"));
+        virNetError(VIR_ERR_RPC,
+                    _("packet %d bytes received from server too small, want %d"),
+                    len, VIR_NET_MESSAGE_LEN_MAX);
         goto cleanup;
     }
 
@@ -110,8 +111,9 @@ int virNetMessageDecodeLength(virNetMessagePtr msg)
     len -= VIR_NET_MESSAGE_LEN_MAX;
 
     if (len > VIR_NET_MESSAGE_MAX) {
-        virNetError(VIR_ERR_RPC, "%s",
-                    _("packet received from server too large"));
+        virNetError(VIR_ERR_RPC,
+                    _("packet %d bytes received from server too large, want %d"),
+                    len, VIR_NET_MESSAGE_MAX);
         goto cleanup;
     }
 
-- 
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]