When the server offers a power channel, automatically connect to it.
---
 src/virt-viewer-session-spice.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index e2cbfbf..29e14be 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -1289,6 +1289,11 @@ virt_viewer_session_spice_channel_new(SpiceSession *s,
         spice_channel_connect(channel);
     }
 
+    if (SPICE_IS_POWER_CHANNEL(channel)) {
+        g_debug("new power channel");
+        spice_channel_connect(channel);
+    }
+
     self->channel_count++;
 }
 
@@ -1420,6 +1425,10 @@ 
virt_viewer_session_spice_channel_destroyed(G_GNUC_UNUSED SpiceSession *s,
         self->audio = NULL;
     }
 
+    if (SPICE_IS_POWER_CHANNEL(channel)) {
+        g_debug("zap power channel");
+    }
+
     if (SPICE_IS_USBREDIR_CHANNEL(channel)) {
         g_debug("zap usbredir channel");
         self->usbredir_channel_count--;
-- 
2.52.0

Reply via email to