diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-08-26 15:14:05 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-09-02 10:22:41 +0200 |
commit | 0c6d654c2f67795fe5c3229bb615ab2bd99ef7a4 (patch) | |
tree | 20fa805160343ebedbeb3e61b726db3ecff67f7b /server/reds.c | |
parent | fc2a84eb5beb4424d99121e2ed79c6bebefaf27e (diff) | |
download | spice-0c6d654c2f67795fe5c3229bb615ab2bd99ef7a4.tar.gz spice-0c6d654c2f67795fe5c3229bb615ab2bd99ef7a4.tar.xz spice-0c6d654c2f67795fe5c3229bb615ab2bd99ef7a4.zip |
Add API to turn on backwards compatibility mode
When upgrading a cluster of machines you typically do this by
upgrading a set of machines at a time, making the new machines run
the new software version, but in a fashion compatible with the old
versions (in terms of e.g. migration). Then when all machines are
upgrades, any new features in the new version can be enabled.
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).
There is no guarantee that any future version of spice support
being compatible with any previous version. However, we will always
support compatibility with the previous major version so that clusters
can be upgraded step by step.
Diffstat (limited to 'server/reds.c')
-rw-r--r-- | server/reds.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c index ca587728..5fafe400 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3768,6 +3768,26 @@ __visible__ void spice_server_destroy(SpiceServer *s) reds_exit(); } +__visible__ spice_compat_version_t spice_get_current_compat_version(void) +{ + return SPICE_COMPAT_VERSION_CURRENT; +} + +__visible__ int spice_server_set_compat_version(SpiceServer *s, + spice_compat_version_t version) +{ + if (version < SPICE_COMPAT_VERSION_0_6) { + /* We don't support 0.4 compat mode atm */ + return -1; + } + + if (version > SPICE_COMPAT_VERSION_CURRENT) { + /* Not compatible with future versions */ + return -1; + } + return 0; +} + __visible__ int spice_server_set_port(SpiceServer *s, int port) { ASSERT(reds == s); |