mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-05 11:09:07 +00:00
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).
This commit is contained in:
parent
761ce02406
commit
67d515b768
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user