summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-19 17:43:39 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-21 16:21:32 +0100
commit9d22757722889e0240cb278f96845f03362cc503 (patch)
treea8b2702fdddaf3bb3dd3b431988e84c28876d64e
parent6cfb7116b9676f5287dafd99ea630608bedd4c11 (diff)
spice: handle switch-host event
Do not disconnect session when switching host (non-seamless migration method). Also, handle a bit better main channel events and do not disconnect on unknown events, however raise unhandled event message to warning level.
-rw-r--r--src/virt-viewer-session-spice.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 3a2bd6f..c000d35 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -307,9 +307,8 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
if (self->priv->session)
spice_session_disconnect(self->priv->session);
break;
- case SPICE_CHANNEL_ERROR_CONNECT:
- DEBUG_LOG("main channel: failed to connect");
- g_signal_emit_by_name(session, "session-disconnected");
+ case SPICE_CHANNEL_SWITCHING:
+ DEBUG_LOG("main channel: switching host");
break;
case SPICE_CHANNEL_ERROR_AUTH:
DEBUG_LOG("main channel: auth failure (wrong password?)");
@@ -331,10 +330,18 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
spice_session_connect(self->priv->session);
}
break;
- default:
- g_message("unhandled spice main channel event: %d", event);
+ case SPICE_CHANNEL_ERROR_CONNECT:
+ DEBUG_LOG("main channel: failed to connect");
+ g_signal_emit_by_name(session, "session-disconnected");
+ break;
+ case SPICE_CHANNEL_ERROR_IO:
+ case SPICE_CHANNEL_ERROR_LINK:
+ case SPICE_CHANNEL_ERROR_TLS:
g_signal_emit_by_name(session, "session-disconnected");
break;
+ default:
+ g_warning("unhandled spice main channel event: %d", event);
+ break;
}
g_free(password);
@@ -435,7 +442,7 @@ virt_viewer_session_spice_channel_new(SpiceSession *s,
g_signal_emit_by_name(session, "session-connected");
- DEBUG_LOG("new session channel (#%d)", id);
+ DEBUG_LOG("new display channel (#%d)", id);
display = virt_viewer_display_spice_new(self,
channel,
spice_display_new(s, id));