[Spice-devel] [PATCH] smartcard: add channel

Alon Levy alevy at redhat.com
Tue Sep 14 11:50:06 PDT 2010


----- "Gerd Hoffmann" <kraxel at redhat.com> wrote:

> Hi,
> 
> > +enum {
> > +    SPICE_MSG_SMARTCARD_DATA = 1,
> > +
> > +    SPICE_MSG_END_SMARTCARD
> > +};
> > +
> > +enum {
> > +    SPICE_MSGC_SMARTCARD_DATA = 1,
> > +
> > +    SPICE_MSGC_END_SMARTCARD
> > +};
> 
> I don't think this is a good idea.  This is just a chardev
> passthrough, 
> right?  If so, then we should just make it that.  Name it 'chardev' or
> 
> 'datapipe' or something simliar.  Have a additional 'init' message to
> 
> specify the kind of chardev.  Then we can just reuse it when we'll
> have 
> more simliar users in the future.
> 

Do you think this is a better direction then adding the actual messages? (see below)

> Or we could make this a real interface definition where each smartcard
> 
> message gets its own message type.
> 

Yes, I was lazy - actually let me back up a little. For the smartcard reader
device to be viable on it's own, it has to talk some protocol that is defined
outside of spice. That protocol is also a header "type/size" protocol, so it is
easy to write the spice.proto channel definition for it - that's were I was lazy
and haven't done it. I guess it's time to be less lazy.

> Oh, and shouldn't the channel-specific messages better start with
> '101' 
> like all other channels do?

Yeah. Anyone know why they start at that particular number?

> 
> cheers,
>    Gerd


More information about the Spice-devel mailing list