Looking at chardev/spice.c code, I realize compilation was broken for
a while with spice-server < 0.12.3. Let's bump required version
to 0.12.5, released May 19 2014, instead of adding more #ifdef.
(this patch combines changes from an early version and some of
Frediano "[PATCH 2/2] spice: Bump required spice-server version to
0.12.6")
According to repology, all the distros that are build target platforms
for QEMU include it:
RHEL-7: 0.14.0
Debian (Stretch): 0.12.8
Debian (Jessie): 0.12.5
FreeBSD (ports): 0.14.0
OpenSUSE Leap 15: 0.14.0
Ubuntu (Xenial): 0.12.6
Note that a previous version of this patch was bumping version to
0.12.6. Unfortunately, Debian Jessie (oldstable) is stuck with spice
server 0.12.5, and QEMU should keep building until after 2y of current
stable (Stretch), which will be around June 17th 2019. Qemu 4.1
should thus be free of bumping to spice-server 0.12.6 during 4.1
development cycle.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id:
20181128155932.16171-1-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
return bytes;
}
-#if SPICE_SERVER_VERSION >= 0x000c02
static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event)
{
SpiceChardev *scd = container_of(sin, SpiceChardev, sin);
trace_spice_vmc_event(chr_event);
qemu_chr_be_event(chr, chr_event);
}
-#endif
static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
{
.state = vmc_state,
.write = vmc_write,
.read = vmc_read,
-#if SPICE_SERVER_VERSION >= 0x000c02
.event = vmc_event,
-#endif
#if SPICE_SERVER_VERSION >= 0x000c06
.flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE,
#endif
}
g_free((char *)s->sin.subtype);
-#if SPICE_SERVER_VERSION >= 0x000c02
g_free((char *)s->sin.portname);
-#endif
}
static void spice_vmc_set_fe_open(struct Chardev *chr, int fe_open)
static void spice_port_set_fe_open(struct Chardev *chr, int fe_open)
{
-#if SPICE_SERVER_VERSION >= 0x000c02
SpiceChardev *s = SPICE_CHARDEV(chr);
if (fe_open) {
} else {
spice_server_port_event(&s->sin, SPICE_PORT_EVENT_CLOSED);
}
-#endif
}
static void spice_chr_accept_input(struct Chardev *chr)
chr_open(chr, type);
}
-#if SPICE_SERVER_VERSION >= 0x000c02
static void qemu_chr_open_spice_port(Chardev *chr,
ChardevBackend *backend,
bool *be_opened,
vmc_register_interface(s);
}
}
-#endif
static void qemu_chr_parse_spice_vmc(QemuOpts *opts, ChardevBackend *backend,
Error **errp)
EOF
spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
- if $pkg_config --atleast-version=0.12.0 spice-server && \
+ if $pkg_config --atleast-version=0.12.5 spice-server && \
$pkg_config --atleast-version=0.12.3 spice-protocol && \
compile_prog "$spice_cflags" "$spice_libs" ; then
spice="yes"
else
if test "$spice" = "yes" ; then
feature_not_found "spice" \
- "Install spice-server(>=0.12.0) and spice-protocol(>=0.12.3) devel"
+ "Install spice-server(>=0.12.5) and spice-protocol(>=0.12.3) devel"
fi
spice="no"
fi
return;
}
trace_qxl_enter_vga_mode(d->id);
-#if SPICE_SERVER_VERSION >= 0x000c03 /* release 0.12.3 */
spice_qxl_driver_unload(&d->ssd.qxl);
-#endif
graphic_console_set_hwops(d->ssd.dcl.con, d->vga.hw_ops, &d->vga);
update_displaychangelistener(&d->ssd.dcl, GUI_REFRESH_INTERVAL_DEFAULT);
qemu_spice_create_host_primary(&d->ssd);
#else
#define SPICE_NEEDS_SET_MM_TIME 0
#endif
-
-#if SPICE_SERVER_VERSION >= 0x000c02
void qemu_spice_register_ports(void);
-#else
-static inline Chardev *qemu_chr_open_spice_port(const char *name)
-{ return NULL; }
-#endif
#else /* CONFIG_SPICE */
}
if (qemu_opt_get_bool(opts, "disable-agent-file-xfer", 0)) {
-#if SPICE_SERVER_VERSION >= 0x000c04
spice_server_set_agent_file_xfer(spice_server, false);
-#else
- error_report("this qemu build does not support the "
- "\"disable-agent-file-xfer\" option");
- exit(1);
-#endif
}
compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ;
g_free(x509_cert_file);
g_free(x509_cacert_file);
-#if SPICE_SERVER_VERSION >= 0x000c02
qemu_spice_register_ports();
-#endif
#ifdef HAVE_SPICE_GL
if (qemu_opt_get_bool(opts, "gl", 0)) {