[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/36] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION
From: |
marcandre . lureau |
Subject: |
[PULL 01/36] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION |
Date: |
Fri, 17 Dec 2021 18:37:21 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
meson.build | 5 +++++
ui/vdagent.c | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/meson.build b/meson.build
index ae67ca28ab38..58718691d7fc 100644
--- a/meson.build
+++ b/meson.build
@@ -1487,6 +1487,11 @@ config_host_data.set('CONFIG_ZSTD', zstd.found())
config_host_data.set('CONFIG_FUSE', fuse.found())
config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found())
config_host_data.set('CONFIG_SPICE_PROTOCOL', spice_protocol.found())
+if spice_protocol.found()
+config_host_data.set('CONFIG_SPICE_PROTOCOL_MAJOR',
spice_protocol.version().split('.')[0])
+config_host_data.set('CONFIG_SPICE_PROTOCOL_MINOR',
spice_protocol.version().split('.')[1])
+config_host_data.set('CONFIG_SPICE_PROTOCOL_MICRO',
spice_protocol.version().split('.')[2])
+endif
config_host_data.set('CONFIG_SPICE', spice.found())
config_host_data.set('CONFIG_X11', x11.found())
config_host_data.set('CONFIG_CFI', get_option('cfi'))
diff --git a/ui/vdagent.c b/ui/vdagent.c
index 19e8fbfc96f1..1f8fc77ee8f3 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -17,6 +17,14 @@
#include "spice/vd_agent.h"
+#define CHECK_SPICE_PROTOCOL_VERSION(major, minor, micro) \
+ (CONFIG_SPICE_PROTOCOL_MAJOR > (major) || \
+ (CONFIG_SPICE_PROTOCOL_MAJOR == (major) && \
+ CONFIG_SPICE_PROTOCOL_MINOR > (minor)) || \
+ (CONFIG_SPICE_PROTOCOL_MAJOR == (major) && \
+ CONFIG_SPICE_PROTOCOL_MINOR == (minor) && \
+ CONFIG_SPICE_PROTOCOL_MICRO >= (micro)))
+
#define VDAGENT_BUFFER_LIMIT (1 * MiB)
#define VDAGENT_MOUSE_DEFAULT true
#define VDAGENT_CLIPBOARD_DEFAULT false
--
2.34.1.8.g35151cf07204
- [PULL 00/36] ui: D-Bus display backend, marcandre . lureau, 2021/12/17
- [PULL 01/36] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION,
marcandre . lureau <=
- [PULL 02/36] ui/vdagent: replace #if 0 with protocol version check, marcandre . lureau, 2021/12/17
- [PULL 03/36] ui: generalize clipboard notifier, marcandre . lureau, 2021/12/17
- [PULL 04/36] ui/vdagent: add serial capability support, marcandre . lureau, 2021/12/17
- [PULL 05/36] ui/clipboard: add qemu_clipboard_check_serial(), marcandre . lureau, 2021/12/17
- [PULL 06/36] ui/clipboard: add a clipboard reset serial event, marcandre . lureau, 2021/12/17
- [PULL 07/36] hw/display: report an error if virgl initialization failed, marcandre . lureau, 2021/12/17
- [PULL 08/36] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP, marcandre . lureau, 2021/12/17
- [PULL 09/36] ui: do not delay further remote resize, marcandre . lureau, 2021/12/17
- [PULL 10/36] ui: factor out qemu_console_set_display_gl_ctx(), marcandre . lureau, 2021/12/17