[Spice-devel] [PATCH 1/1] Add API to turn on backwards compatibility mode

Gerd Hoffmann kraxel at redhat.com
Fri Aug 27 00:16:57 PDT 2010


   Hi,

> This API allows qemu to limit the set of features that spice uses to
> those compatible with an older version, in order to do an upgrade like
> this. Right now it doesn't really do much, since we don't keep compat
> with 0.4.0 atm (although that may be added later).

As you are talking about "set of features" already ...

I think we should use a feature bitmask instead of a version number in 
the API.

> +__visible__ spice_compat_version_t spice_get_current_compat_version(void)

uint64_t spice_get_supported_features();

> +__visible__ int spice_server_set_compat_version(SpiceServer *s,
> +                                                spice_compat_version_t version)

spice_server_enable_features(SpiceServer *s, uint64_t features);

> +/* Don't use features incompatible with a specific spice
> +   version, so that migration to/from that version works. */
> +typedef enum {
> +    SPICE_COMPAT_VERSION_0_4 = 0,
> +    SPICE_COMPAT_VERSION_0_6 = 1,
> +} spice_compat_version_t;

/* 0.6 */
#define SPICE_FEATURE_PROTOCOL_MAJOR2  (1<<0)
#define SPICE_FEATURE_SURFACES         (1<<1)

/* 0.8 */
#define SPICE_FEATURE_MULTIMONITOR     (1<<2)

/* for convinience */
#define SPICE_FEATURES_MASK_V06 \
     (SPICE_FEATURE_PROTOCOL_MAJOR2 | SPICE_FEATURE_SURFACES)
#define SPICE_FEATURES_MASK_V08 \
     (SPICE_FEATURES_MASK_V06 | SPICE_FEATURE_MULTIMONITOR)

Another question is whenever we want prepare for 0.4 compatibility.
I think the only use case would be to allow 0.4 clients connect to the 
0.6 spice server.  Wasn't the plan to upgrade the clients instead?

So we could also start with an empty feature mask in 0.6 ...

cheers,
   Gerd



More information about the Spice-devel mailing list