ui/spice: Require spice-server >= 0.14.0

Version 0.14.0 is now old enough to have made it into the major
distributions:

     Debian 11: 0.14.3
     RHEL-8: 0.14.3
     FreeBSD (ports): 0.15.0
     Fedora 35: 0.15.0
     Ubuntu 20.04: 0.14.2
     OpenSUSE Leap 15.3: 0.14.3

Requiring it lets us drop a number of version checks.  The next commit
will clean up some more.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230109190321.1056914-6-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2023-01-09 20:03:09 +01:00
parent f4c1bcb8c4
commit 34d55725e6
6 changed files with 3 additions and 18 deletions

View File

@ -98,9 +98,7 @@ static SpiceCharDeviceInterface vmc_interface = {
.write = vmc_write, .write = vmc_write,
.read = vmc_read, .read = vmc_read,
.event = vmc_event, .event = vmc_event,
#if SPICE_SERVER_VERSION >= 0x000c06
.flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE, .flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
#endif
}; };

View File

@ -260,8 +260,7 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG, QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
0)); 0));
} else { } else {
/* >= release 0.12.6, < release 0.14.2 */ #if SPICE_SERVER_VERSION < 0x000e02 /* release 0.14.2 */
#if SPICE_SERVER_VERSION >= 0x000c06 && SPICE_SERVER_VERSION < 0x000e02
if (qxl->max_outputs) { if (qxl->max_outputs) {
spice_qxl_set_max_monitors(&qxl->ssd.qxl, qxl->max_outputs); spice_qxl_set_max_monitors(&qxl->ssd.qxl, qxl->max_outputs);
} }
@ -1089,12 +1088,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
return 1; return 1;
} }
#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
/* limit number of outputs based on setting limit */ /* limit number of outputs based on setting limit */
if (qxl->max_outputs && qxl->max_outputs <= max_outputs) { if (qxl->max_outputs && qxl->max_outputs <= max_outputs) {
max_outputs = qxl->max_outputs; max_outputs = qxl->max_outputs;
} }
#endif
config_changed = qxl_rom_monitors_config_changed(rom, config_changed = qxl_rom_monitors_config_changed(rom,
monitors_config, monitors_config,
@ -2487,9 +2484,7 @@ static Property qxl_properties[] = {
DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1), DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1),
DEFINE_PROP_UINT32("vgamem_mb", PCIQXLDevice, vgamem_size_mb, 16), DEFINE_PROP_UINT32("vgamem_mb", PCIQXLDevice, vgamem_size_mb, 16),
DEFINE_PROP_INT32("surfaces", PCIQXLDevice, ssd.num_surfaces, 1024), DEFINE_PROP_INT32("surfaces", PCIQXLDevice, ssd.num_surfaces, 1024),
#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
DEFINE_PROP_UINT16("max_outputs", PCIQXLDevice, max_outputs, 0), DEFINE_PROP_UINT16("max_outputs", PCIQXLDevice, max_outputs, 0),
#endif
DEFINE_PROP_UINT32("xres", PCIQXLDevice, xres, 0), DEFINE_PROP_UINT32("xres", PCIQXLDevice, xres, 0),
DEFINE_PROP_UINT32("yres", PCIQXLDevice, yres, 0), DEFINE_PROP_UINT32("yres", PCIQXLDevice, yres, 0),
DEFINE_PROP_BOOL("global-vmstate", PCIQXLDevice, vga.global_vmstate, false), DEFINE_PROP_BOOL("global-vmstate", PCIQXLDevice, vga.global_vmstate, false),

View File

@ -99,9 +99,7 @@ struct PCIQXLDevice {
QXLModes *modes; QXLModes *modes;
uint32_t rom_size; uint32_t rom_size;
MemoryRegion rom_bar; MemoryRegion rom_bar;
#if SPICE_SERVER_VERSION >= 0x000c06 /* release 0.12.6 */
uint16_t max_outputs; uint16_t max_outputs;
#endif
/* vram pci bar */ /* vram pci bar */
uint64_t vram_size; uint64_t vram_size;

View File

@ -34,13 +34,9 @@ int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con);
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
const char *subject); const char *subject);
#if !defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)
#define SPICE_NEEDS_SET_MM_TIME 1
#else
#define SPICE_NEEDS_SET_MM_TIME 0 #define SPICE_NEEDS_SET_MM_TIME 0
#endif
#if defined(SPICE_SERVER_VERSION) && (SPICE_SERVER_VERSION >= 0x000f00) #if SPICE_SERVER_VERSION >= 0x000f00 /* release 0.15.0 */
#define SPICE_HAS_ATTACHED_WORKER 1 #define SPICE_HAS_ATTACHED_WORKER 1
#else #else
#define SPICE_HAS_ATTACHED_WORKER 0 #define SPICE_HAS_ATTACHED_WORKER 0

View File

@ -28,11 +28,9 @@
#include "ui/console.h" #include "ui/console.h"
#if defined(CONFIG_OPENGL) && defined(CONFIG_GBM) #if defined(CONFIG_OPENGL) && defined(CONFIG_GBM)
# if SPICE_SERVER_VERSION >= 0x000d01 /* release 0.13.1 */
# define HAVE_SPICE_GL 1 # define HAVE_SPICE_GL 1
# include "ui/egl-helpers.h" # include "ui/egl-helpers.h"
# include "ui/egl-context.h" # include "ui/egl-context.h"
# endif
#endif #endif
#define NUM_MEMSLOTS 8 #define NUM_MEMSLOTS 8

View File

@ -748,7 +748,7 @@ if not get_option('spice_protocol').auto() or have_system
endif endif
spice = not_found spice = not_found
if not get_option('spice').auto() or have_system if not get_option('spice').auto() or have_system
spice = dependency('spice-server', version: '>=0.12.5', spice = dependency('spice-server', version: '>=0.14.0',
required: get_option('spice'), required: get_option('spice'),
method: 'pkg-config', kwargs: static_kwargs) method: 'pkg-config', kwargs: static_kwargs)
endif endif