[Spice-devel] Purpose of interface version checks in server/reds.c

Christophe Fergeau cfergeau at redhat.com
Tue Jul 5 01:57:17 PDT 2011


On Mon, Jul 04, 2011 at 02:37:09PM +0200, Christophe Fergeau wrote:
> On Mon, Jul 04, 2011 at 01:27:16PM +0200, Gerd Hoffmann wrote:
> > On 07/01/11 15:58, Christophe Fergeau wrote:
> > >if (strcmp(interface->type, SPICE_INTERFACE_RECORD) == 0) {
> > >     red_printf("SPICE_INTERFACE_RECORD");
> > >     if (interface->major_version != SPICE_INTERFACE_RECORD_MAJOR ||
> > >         interface->minor_version<  SPICE_INTERFACE_RECORD_MINOR) {
> > >         red_printf("unsupported record interface");
> > >         return -1;
> > >     }
> > >     snd_attach_record(SPICE_CONTAINEROF(sin, SpiceRecordInstance, base));
> > >}
> > 
> > That looks bogous.
> 
> Given your explanation below, I agree with you. I'm wondering if what was
> originally intended was the opposite check, ie fail to create the channel
> if QEMU supports a *newer* version of the interface than the installed
> spice-server. Otherwise I'll make a patch to 
> - fail the channel creation if interface->major_version !=
>   SPICE_INTERFACE_RECORD_MAJOR
> - only log a message if interface->minor_version<
>   SPICE_INTERFACE_RECORD_MINOR) (but create the channel anyway)

Does anyone have any thoughts on what was intended in this code?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110705/cfb203e1/attachment.pgp>


More information about the Spice-devel mailing list