Hi

On Thu, Dec 4, 2025 at 7:42 PM Vladimir Sementsov-Ogievskiy <
[email protected]> wrote:

> 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 <[email protected]>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
>

Reviewed-by: Marc-André Lureau <[email protected]>


> ---
>  chardev/spice.c         |  6 ------
>  hw/display/qxl.c        | 11 ++---------
>  include/ui/qemu-spice.h |  4 ----
>  meson.build             |  2 +-
>  ui/spice-display.c      |  8 ++------
>  5 files changed, 5 insertions(+), 26 deletions(-)
>
> diff --git a/chardev/spice.c b/chardev/spice.c
> index db53b49da2..39b79d60fb 100644
> --- a/chardev/spice.c
> +++ b/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);
>  }
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 18f482ca7f..0fa8a3204d 100644
> --- a/hw/display/qxl.c
> +++ b/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);
>
> diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
> index b7d493742c..8e5e6b2a74 100644
> --- a/include/ui/qemu-spice.h
> +++ b/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 */
>
> diff --git a/meson.build b/meson.build
> index d9293294d8..975e842f70 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1357,7 +1357,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
> diff --git a/ui/spice-display.c b/ui/spice-display.c
> index db71e866f8..f2304bb0ce 100644
> --- a/ui/spice-display.c
> +++ b/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);
>
> --
> 2.48.1
>
>

Reply via email to