[Spice-devel,spice-common,1/3] smartcard: build fixes for spice server

Submitted by Alon Levy on June 14, 2012, 11:03 a.m.

Details

Message ID 1339671807-29069-2-git-send-email-alevy@redhat.com
State Accepted
Commit 535b52db66a6936840ed7323fe809fad780485ba
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy June 14, 2012, 11:03 a.m.
Define different enums that have a SPICE_ prefix to not conflict with same
value enums from libcacard/vsccard_common.h, and continue to use the same
SPICE_MSG_SMARTCARD_DATA and SPICE_MSGC_SMARTCARD_DATA enum that is used by the
server and clients (spice-gtk, spicec) alike.
---
 common/client_marshallers.h |    2 +-
 spice.proto                 |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/common/client_marshallers.h b/common/client_marshallers.h
index f7322d1..1bd95ae 100644
--- a/common/client_marshallers.h
+++ b/common/client_marshallers.h
@@ -66,7 +66,7 @@  typedef struct {
     void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg);
     void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg);
     void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg);
-    void (*msgc_smartcard_msg)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
+    void (*msgc_smartcard_data)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
     void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg);
 #endif
 } SpiceMessageMarshallers;
diff --git a/spice.proto b/spice.proto
index 71be9ac..a86bfa7 100644
--- a/spice.proto
+++ b/spice.proto
@@ -1139,7 +1139,7 @@  enum32 vsc_message_type {
     APDU,
     Flush,
     FlushComplete
-} @prefix(VSC_);
+};
 
 struct VscMessageHeader {
     vsc_message_type type;
@@ -1170,7 +1170,7 @@  channel SmartcardChannel : BaseChannel {
 	uint32 reader_id;
 	uint32 length;
 	uint8 data[] @end;
-    } @ctype(SpiceMsgSmartcard) msg = 101;
+    } @ctype(SpiceMsgSmartcard) data = 101;
 
  client:
     message {
@@ -1184,7 +1184,7 @@  channel SmartcardChannel : BaseChannel {
 	case Error:
 	    VscMessageError error;
 	} u @anon;
-    } @ctype(SpiceMsgcSmartcard) msg = 101;
+    } @ctype(SpiceMsgcSmartcard) data = 101;
 
     message {
 	vsc_message_type type;

Comments

On Thu, Jun 14, 2012 at 02:03:24PM +0300, Alon Levy wrote:
> Define different enums that have a SPICE_ prefix to not conflict with same
> value enums from libcacard/vsccard_common.h, and continue to use the same
> SPICE_MSG_SMARTCARD_DATA and SPICE_MSGC_SMARTCARD_DATA enum that is used by the
> server and clients (spice-gtk, spicec) alike.

Doesn't it make more sense to rename data to msg there? Or is it harder?
ACK either way.

Christophe

> ---
>  common/client_marshallers.h |    2 +-
>  spice.proto                 |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/common/client_marshallers.h b/common/client_marshallers.h
> index f7322d1..1bd95ae 100644
> --- a/common/client_marshallers.h
> +++ b/common/client_marshallers.h
> @@ -66,7 +66,7 @@ typedef struct {
>      void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg);
>      void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg);
>      void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg);
> -    void (*msgc_smartcard_msg)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
> +    void (*msgc_smartcard_data)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
>      void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg);
>  #endif
>  } SpiceMessageMarshallers;
> diff --git a/spice.proto b/spice.proto
> index 71be9ac..a86bfa7 100644
> --- a/spice.proto
> +++ b/spice.proto
> @@ -1139,7 +1139,7 @@ enum32 vsc_message_type {
>      APDU,
>      Flush,
>      FlushComplete
> -} @prefix(VSC_);
> +};
>  
>  struct VscMessageHeader {
>      vsc_message_type type;
> @@ -1170,7 +1170,7 @@ channel SmartcardChannel : BaseChannel {
>  	uint32 reader_id;
>  	uint32 length;
>  	uint8 data[] @end;
> -    } @ctype(SpiceMsgSmartcard) msg = 101;
> +    } @ctype(SpiceMsgSmartcard) data = 101;
>  
>   client:
>      message {
> @@ -1184,7 +1184,7 @@ channel SmartcardChannel : BaseChannel {
>  	case Error:
>  	    VscMessageError error;
>  	} u @anon;
> -    } @ctype(SpiceMsgcSmartcard) msg = 101;
> +    } @ctype(SpiceMsgcSmartcard) data = 101;
>  
>      message {
>  	vsc_message_type type;
> -- 
> 1.7.10.1
>
On Wed, Jun 20, 2012 at 01:21:46PM +0200, Christophe Fergeau wrote:
> On Thu, Jun 14, 2012 at 02:03:24PM +0300, Alon Levy wrote:
> > Define different enums that have a SPICE_ prefix to not conflict with same
> > value enums from libcacard/vsccard_common.h, and continue to use the same
> > SPICE_MSG_SMARTCARD_DATA and SPICE_MSGC_SMARTCARD_DATA enum that is used by the
> > server and clients (spice-gtk, spicec) alike.
> 
> Doesn't it make more sense to rename data to msg there? Or is it harder?
> ACK either way.

I agree that msg is a nicer name but renaming for the sake of renaming
seems wrong, it doesn't solve any real problem, and it requires more
changes (rename every user of DATA, in this case the server).

> 
> Christophe
> 
> > ---
> >  common/client_marshallers.h |    2 +-
> >  spice.proto                 |    6 +++---
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/common/client_marshallers.h b/common/client_marshallers.h
> > index f7322d1..1bd95ae 100644
> > --- a/common/client_marshallers.h
> > +++ b/common/client_marshallers.h
> > @@ -66,7 +66,7 @@ typedef struct {
> >      void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg);
> >      void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg);
> >      void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg);
> > -    void (*msgc_smartcard_msg)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
> > +    void (*msgc_smartcard_data)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out);
> >      void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg);
> >  #endif
> >  } SpiceMessageMarshallers;
> > diff --git a/spice.proto b/spice.proto
> > index 71be9ac..a86bfa7 100644
> > --- a/spice.proto
> > +++ b/spice.proto
> > @@ -1139,7 +1139,7 @@ enum32 vsc_message_type {
> >      APDU,
> >      Flush,
> >      FlushComplete
> > -} @prefix(VSC_);
> > +};
> >  
> >  struct VscMessageHeader {
> >      vsc_message_type type;
> > @@ -1170,7 +1170,7 @@ channel SmartcardChannel : BaseChannel {
> >  	uint32 reader_id;
> >  	uint32 length;
> >  	uint8 data[] @end;
> > -    } @ctype(SpiceMsgSmartcard) msg = 101;
> > +    } @ctype(SpiceMsgSmartcard) data = 101;
> >  
> >   client:
> >      message {
> > @@ -1184,7 +1184,7 @@ channel SmartcardChannel : BaseChannel {
> >  	case Error:
> >  	    VscMessageError error;
> >  	} u @anon;
> > -    } @ctype(SpiceMsgcSmartcard) msg = 101;
> > +    } @ctype(SpiceMsgcSmartcard) data = 101;
> >  
> >      message {
> >  	vsc_message_type type;
> > -- 
> > 1.7.10.1
> >