Browse Source

ui/spice: Require spice-server >= 0.15.0

For major distributions we have now:

    Debian 13: 0.15.2
    Ubuntu 22.04: 0.15.0
    RHEL-9/CentOS Stream 9: SPICE is removed
    Fedora 42: 0.15.1
    OpenSUSE Leap 15.4: 0.15.0

Time to update the dependancy in QEMU and drop almost all
SPICE_SERVER_VERSION checks.

Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260115144606.233252-2-vsementsov@yandex-team.ru>
master
Vladimir Sementsov-Ogievskiy 2 months ago
committed by Marc-André Lureau
parent
commit
bd5058cf08
  1. 6
      chardev/spice.c
  2. 11
      hw/display/qxl.c
  3. 4
      include/ui/qemu-spice.h
  4. 2
      meson.build
  5. 8
      ui/spice-display.c

6
chardev/spice.c

@ -278,12 +278,6 @@ static void qemu_chr_open_spice_vmc(Chardev *chr,
}
*be_opened = false;
#if SPICE_SERVER_VERSION < 0x000e02
/* Spice < 0.14.2 doesn't explicitly open smartcard chardev */
if (strcmp(type, "smartcard") == 0) {
*be_opened = true;
}
#endif
chr_open(chr, type);
}

11
hw/display/qxl.c

@ -261,11 +261,6 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
0));
} else {
#if SPICE_SERVER_VERSION < 0x000e02 /* release 0.14.2 */
if (qxl->max_outputs) {
spice_qxl_set_max_monitors(&qxl->ssd.qxl, qxl->max_outputs);
}
#endif
qxl->guest_monitors_config = qxl->ram->monitors_config;
spice_qxl_monitors_config_async(&qxl->ssd.qxl,
qxl->ram->monitors_config,
@ -2109,6 +2104,8 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
uint8_t* config = qxl->pci.config;
uint32_t pci_device_rev;
uint32_t io_size;
Error *err = NULL;
char device_address[256] = "";
qemu_spice_display_init_common(&qxl->ssd);
qxl->mode = QXL_MODE_UNDEFINED;
@ -2208,9 +2205,6 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
return;
}
#if SPICE_SERVER_VERSION >= 0x000e02 /* release 0.14.2 */
Error *err = NULL;
char device_address[256] = "";
if (qemu_console_fill_device_address(qxl->vga.con,
device_address, sizeof(device_address),
&err)) {
@ -2221,7 +2215,6 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
} else {
error_report_err(err);
}
#endif
qemu_add_vm_change_state_handler(qxl_vm_change_state_handler, qxl);

4
include/ui/qemu-spice.h

@ -34,11 +34,7 @@ int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con);
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
const char *subject);
#if SPICE_SERVER_VERSION >= 0x000f00 /* release 0.15.0 */
#define SPICE_HAS_ATTACHED_WORKER 1
#else
#define SPICE_HAS_ATTACHED_WORKER 0
#endif
#else /* CONFIG_SPICE */

2
meson.build

@ -1326,7 +1326,7 @@ if get_option('spice') \
.require(pixman.found(),
error_message: 'cannot enable SPICE if pixman is not available') \
.allowed()
spice = dependency('spice-server', version: '>=0.14.0',
spice = dependency('spice-server', version: '>=0.15.0',
required: get_option('spice'),
method: 'pkg-config')
endif

8
ui/spice-display.c

@ -689,13 +689,11 @@ static int interface_client_monitors_config(QXLInstance *sin,
if (mc->num_of_monitors > head) {
info.width = mc->monitors[head].width;
info.height = mc->monitors[head].height;
#if SPICE_SERVER_VERSION >= 0x000e04 /* release 0.14.4 */
if (mc->flags & VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE) {
VDAgentMonitorMM *mm = (void *)&mc->monitors[mc->num_of_monitors];
info.width_mm = mm[head].width;
info.height_mm = mm[head].height;
}
#endif
}
trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height);
@ -1393,6 +1391,8 @@ static const DisplayGLCtxOps gl_ctx_ops = {
static void qemu_spice_display_init_one(QemuConsole *con)
{
SimpleSpiceDisplay *ssd = g_new0(SimpleSpiceDisplay, 1);
Error *err = NULL;
char device_address[256] = "";
qemu_spice_display_init_common(ssd);
@ -1414,9 +1414,6 @@ static void qemu_spice_display_init_one(QemuConsole *con)
ssd->qxl.base.sif = &dpy_interface.base;
qemu_spice_add_display_interface(&ssd->qxl, con);
#if SPICE_SERVER_VERSION >= 0x000e02 /* release 0.14.2 */
Error *err = NULL;
char device_address[256] = "";
if (qemu_console_fill_device_address(con, device_address, 256, &err)) {
spice_qxl_set_device_info(&ssd->qxl,
device_address,
@ -1425,7 +1422,6 @@ static void qemu_spice_display_init_one(QemuConsole *con)
} else {
error_report_err(err);
}
#endif
qemu_spice_create_host_memslot(ssd);

Loading…
Cancel
Save