[Spice-devel] [PATCH v2] Use red_channel_client_get_stream()

Jonathon Jongsma jjongsma at redhat.com
Tue Aug 30 15:57:01 UTC 2016


Don't touch the rcc struct directly. Improve encapsulation to help
prepare for separating RedChannelClient to a separate file.
---
Changes since v1:
 - changed a couple more cases where the stream was accessed directly

 server/dcc.c      | 4 ++--
 server/spicevmc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 8eca28b..92dcc47 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -459,7 +459,7 @@ void dcc_start(DisplayChannelClient *dcc)
         dcc_create_all_streams(dcc);
     }
 
-    if (reds_stream_is_plain_unix(rcc->stream) &&
+    if (reds_stream_is_plain_unix(red_channel_client_get_stream(rcc)) &&
         red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_GL_SCANOUT)) {
         red_channel_client_pipe_add(rcc, dcc_gl_scanout_item_new(rcc, NULL, 0));
         dcc_push_monitors_config(dcc);
@@ -573,7 +573,7 @@ RedPipeItem *dcc_gl_scanout_item_new(RedChannelClient *rcc, void *data, int num)
     spice_return_val_if_fail(item != NULL, NULL);
 
     /* FIXME: on !unix peer, start streaming with a video codec */
-    if (!reds_stream_is_plain_unix(rcc->stream) ||
+    if (!reds_stream_is_plain_unix(red_channel_client_get_stream(rcc)) ||
         !red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_GL_SCANOUT)) {
         spice_printerr("FIXME: client does not support GL scanout");
         red_channel_client_disconnect(rcc);
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 4e9dd0d..c79e7bb 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -127,7 +127,7 @@ static RedVmcPipeItem* try_compress_lz4(SpiceVmcState *state, int n, RedVmcPipeI
     RedVmcPipeItem *msg_item_compressed;
     int compressed_data_count;
 
-    if (reds_stream_get_family(state->rcc->stream) == AF_UNIX) {
+    if (reds_stream_get_family(red_channel_client_get_stream(state->rcc)) == AF_UNIX) {
         /* AF_LOCAL - data will not be compressed */
         return NULL;
     }
-- 
2.7.4



More information about the Spice-devel mailing list