[Spice-devel] Purpose of interface version checks in server/reds.c
Christophe Fergeau
cfergeau at redhat.com
Fri Jul 1 06:58:01 PDT 2011
Hi,
While looking at a crash in qemu when SPICE_INTERFACE_PLAYBACK_MINOR was
increased, I came across the version checking code in spice_server_add_interface
in server/reds.c which does stuff like
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));
}
interface->major_version/interface->minor_version are filled in
qemu/audio/spiceaudio.c using compile time constants from spice-server.
It seems to be useful to detect when qemu was compiled against an older
spice-server than the one that is currently installed.
I'm a bit surprised by this mechanism, if we break these interfaces in such
a way that qemu needs to be recompiled, shouldn't we use different library
sonames to make sure things are recompiled?
I'm basically curious about exactly what problem is this mechanism solving
so that I don't break it by mistake :)
Thanks,
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/20110701/3a4949d2/attachment.pgp>
More information about the Spice-devel
mailing list