[Spice-commits] server/red_dispatcher.c
Uri Lublin
uril at kemper.freedesktop.org
Wed Oct 24 03:13:02 PDT 2012
server/red_dispatcher.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
New commits:
commit 67d515b7680f6f44e4781f2e51e1c4bfd21527ff
Author: Uri Lublin <uril at redhat.com>
Date: Thu Oct 11 14:32:47 2012 +0200
server: red_dispatcher: check major/minor of qxl for client_monitors_config
This solves a problem with new spice-server and old qemu-kvm, where spice thinks
qif->client_monitors_config exists, while it does not exist in qemu-kvm.
Also "major > required_major" was added to the condition.
Also only the specific RedDispatcher is checked (and not all dispatchers).
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 39d05ab..97e9737 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -83,20 +83,13 @@ extern spice_wan_compression_t zlib_glz_state;
static RedDispatcher *dispatchers = NULL;
-static int red_dispatcher_version_check(int major, int minor)
+static int red_dispatcher_check_qxl_version(RedDispatcher *rd, int major, int minor)
{
- if (num_active_workers > 0) {
- RedDispatcher *now = dispatchers;
- while (now) {
- if (now->base.major_version != major ||
- now->base.minor_version < minor) {
- return FALSE;
- }
- now = now->next;
- }
- return TRUE;
- }
- return FALSE;
+ int qxl_major = rd->qxl->st->qif->base.major_version;
+ int qxl_minor = rd->qxl->st->qif->base.minor_version;
+
+ return ((qxl_major > major) ||
+ ((qxl_major == major) && (qxl_minor >= minor)));
}
static void red_dispatcher_set_display_peer(RedChannel *channel, RedClient *client,
@@ -320,7 +313,7 @@ int red_dispatcher_use_client_monitors_config(void)
}
for (; now ; now = now->next) {
- if (!red_dispatcher_version_check(3, 3) ||
+ if (!red_dispatcher_check_qxl_version(now, 3, 3) ||
!now->qxl->st->qif->client_monitors_config ||
!now->qxl->st->qif->client_monitors_config(now->qxl, NULL)) {
return FALSE;
More information about the Spice-commits
mailing list