Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 11

libvirt-0.8.2-29.el5.src.rpm

From 60203cfbcbb7b2d2cb15b79bfeeb0f597f61deac Mon Sep 17 00:00:00 2001
Message-Id: <60203cfbcbb7b2d2cb15b79bfeeb0f597f61deac.1284409900.git.jdenemar@redhat.com>
From: Daniel P. Berrange <berrange@redhat.com>
Date: Tue, 17 Aug 2010 10:23:27 -0400
Subject: [PATCH] Add explicit warning messages when failing to serialize to XDR

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=630626

When libvirtd fails to serialize a message to XDR the client
connection is terminated immediately. To enable this to be
diagnosed, log the message which caused the problem on the
server

* daemon/dispatch.c: Log XDR serialization failures
(cherry picked from commit 677c834ca7ddb267657c2b951d9770e0854946f9)
---
 daemon/dispatch.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/daemon/dispatch.c b/daemon/dispatch.c
index 8f55eaa..9d1abc0 100644
--- a/daemon/dispatch.c
+++ b/daemon/dispatch.c
@@ -194,6 +194,8 @@ remoteSerializeError(struct qemud_client *client,
     return 0;
 
 xdr_error:
+    VIR_WARN("Failed to serialize remote error '%s' as XDR",
+             rerr->message ? *rerr->message : "<unknown>");
     xdr_destroy(&xdr);
     VIR_FREE(msg);
 fatal_error:
@@ -581,6 +583,8 @@ xdr_error:
     xdr_free (data->ret_filter, (char*)&ret);
     xdr_destroy (&xdr);
 fatal_error:
+    VIR_WARN("Failed to serialize reply for program '%d' proc '%d' as XDR",
+             msg->hdr.prog, msg->hdr.proc);
     return -1;
 }
 
@@ -664,5 +668,7 @@ xdr_error:
     xdr_destroy (&xdr);
 fatal_error:
     VIR_FREE(msg);
+    VIR_WARN("Failed to serialize stream data for proc %d as XDR",
+             stream->procedure);
     return -1;
 }
-- 
1.7.2.2