[virt-tools-list] [virt-viewer][PATCH 3/3] spice-session: use the error message, when available, on _channel_destroy()

Fabiano Fidêncio fidencio at redhat.com
Thu Apr 9 11:36:51 UTC 2015


Related to: rhbz#1085216
---
 src/virt-viewer-session-spice.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 10dd149..353e02b 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -900,12 +900,15 @@ virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s,
 {
     VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
     int id;
+    const GError *error;
 
     g_return_if_fail(self != NULL);
 
     g_object_get(channel, "channel-id", &id, NULL);
     g_debug("Destroy SPICE channel %s %d", g_type_name(G_OBJECT_TYPE(channel)), id);
 
+    error = spice_channel_get_error(channel);
+
     if (SPICE_IS_MAIN_CHANNEL(channel)) {
         g_debug("zap main channel");
         if (channel == SPICE_CHANNEL(self->priv->main_channel))
@@ -931,7 +934,7 @@ virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s,
 
     self->priv->channel_count--;
     if (self->priv->channel_count == 0)
-        g_signal_emit_by_name(self, "session-disconnected", NULL);
+        g_signal_emit_by_name(self, "session-disconnected", error ? error->message : NULL);
 }
 
 #define UUID_LEN 16
-- 
2.3.4




More information about the virt-tools-list mailing list