[Spice-devel] [PATCH spice-server] Do not use possibly undefined SPICE_CHANNEL_TUNNEL

Frediano Ziglio fziglio at redhat.com
Mon Feb 25 12:23:38 UTC 2019


> 
> Hi,
> 
> On Mon, Feb 25, 2019 at 08:37:23AM +0000, Frediano Ziglio wrote:
> > The channel was removed from the protocol and marked as
> > obsolete. Potentially will be removed from spice/enums.h
> > when regenerated.
> 
> Should it really be removed?
> 

I had the same question. Could be an option to add a "fake" empty
Tunnel channel again, something like

channel TunnelChannel {
};

(yes, it works, just tried!)
The code added is really small (a couple of empty functions and
2 additional entries in a static array).

Diff would be:


diff --git a/spice.proto b/spice.proto
index de80b27..1f9f57b 100644
--- a/spice.proto
+++ b/spice.proto
@@ -1235,6 +1235,9 @@ channel RecordChannel : BaseChannel {
     } @declare start_mark;
 };
 
+channel TunnelChannel {
+};
+
 enum32 vsc_message_type {
     Init = 1,
     Error,
@@ -1357,8 +1360,8 @@ protocol Spice {
     CursorChannel cursor;
     PlaybackChannel playback;
     RecordChannel record;
-    // there used to be a TunnelChannel
-    SmartcardChannel smartcard = 8;
+    TunnelChannel tunnel;
+    SmartcardChannel smartcard;
     UsbredirChannel usbredir;
     PortChannel port;
     WebDAVChannel webdav;


> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/utils.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/server/utils.c b/server/utils.c
> > index b440c0648..d2d3669bd 100644
> > --- a/server/utils.c
> > +++ b/server/utils.c
> > @@ -62,7 +62,7 @@ static const char *const channel_names[] = {
> >      [ SPICE_CHANNEL_CURSOR   ] = "cursor",
> >      [ SPICE_CHANNEL_PLAYBACK ] = "playback",
> >      [ SPICE_CHANNEL_RECORD   ] = "record",
> > -    [ SPICE_CHANNEL_TUNNEL   ] = "tunnel",
> > +    [ 7 /* SPICE_CHANNEL_TUNNEL */ ] = "tunnel",
> 
> I think this is fine anyway.
> Acked-by: Victor Toso <victortoso at redhat.com>
> 
> >      [ SPICE_CHANNEL_SMARTCARD] = "smartcard",
> >      [ SPICE_CHANNEL_USBREDIR ] = "usbredir",
> >      [ SPICE_CHANNEL_PORT     ] = "port",

Frediano


More information about the Spice-devel mailing list