* [PATCH] spice: remove obsolete callback
@ 2020-09-18 10:07 marcandre.lureau
2020-09-18 10:19 ` Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: marcandre.lureau @ 2020-09-18 10:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, kraxel, fziglio
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The "attach_worker" callbacks aren't doing anything in QEMU, but they
were mandatory until Spice server commit
6aa1a17c69dc3cc02f338a78b3266e4c00ea1c1a ("spice-qxl: Remove QXLWorker
definition").
Furthermore, the old spelling is deprecated since commit
974692bda1e77af92b71ed43b022439448492cb9 ("spice-qxl: Fix typo in
callback name and remove obsolete parameter")
Compile that code out if Spice server version is recent enough.
Fix compiler deprecation warnings with Spice > 0.14.3 (not released
yet). We may want to wait until newer version is actually released to
apply the patch.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/display/qxl.c | 4 ++++
ui/spice-display.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 11871340e7..a02072dee0 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -518,12 +518,14 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
/* spice display interface callbacks */
+#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
{
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
trace_qxl_interface_attach_worker(qxl->id);
}
+#endif
static void interface_set_compression_level(QXLInstance *sin, int level)
{
@@ -1156,7 +1158,9 @@ static const QXLInterface qxl_interface = {
.base.major_version = SPICE_INTERFACE_QXL_MAJOR,
.base.minor_version = SPICE_INTERFACE_QXL_MINOR,
+#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
.attache_worker = interface_attach_worker,
+#endif
.set_compression_level = interface_set_compression_level,
#if SPICE_NEEDS_SET_MM_TIME
.set_mm_time = interface_set_mm_time,
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 19632fdf6c..811936ff7f 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -500,10 +500,12 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
/* spice display interface callbacks */
+#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
{
/* nothing to do */
}
+#endif
static void interface_set_compression_level(QXLInstance *sin, int level)
{
@@ -709,7 +711,9 @@ static const QXLInterface dpy_interface = {
.base.major_version = SPICE_INTERFACE_QXL_MAJOR,
.base.minor_version = SPICE_INTERFACE_QXL_MINOR,
+#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
.attache_worker = interface_attach_worker,
+#endif
.set_compression_level = interface_set_compression_level,
#if SPICE_NEEDS_SET_MM_TIME
.set_mm_time = interface_set_mm_time,
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spice: remove obsolete callback
2020-09-18 10:07 [PATCH] spice: remove obsolete callback marcandre.lureau
@ 2020-09-18 10:19 ` Philippe Mathieu-Daudé
2020-09-18 11:24 ` Frediano Ziglio
2020-09-21 8:02 ` Gerd Hoffmann
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-18 10:19 UTC (permalink / raw)
To: marcandre.lureau, qemu-devel; +Cc: kraxel, fziglio
On 9/18/20 12:07 PM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The "attach_worker" callbacks aren't doing anything in QEMU, but they
> were mandatory until Spice server commit
> 6aa1a17c69dc3cc02f338a78b3266e4c00ea1c1a ("spice-qxl: Remove QXLWorker
> definition").
>
> Furthermore, the old spelling is deprecated since commit
> 974692bda1e77af92b71ed43b022439448492cb9 ("spice-qxl: Fix typo in
> callback name and remove obsolete parameter")
>
> Compile that code out if Spice server version is recent enough.
>
> Fix compiler deprecation warnings with Spice > 0.14.3 (not released
> yet). We may want to wait until newer version is actually released to
> apply the patch.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/display/qxl.c | 4 ++++
> ui/spice-display.c | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 11871340e7..a02072dee0 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -518,12 +518,14 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
>
> /* spice display interface callbacks */
>
What about adding in include/ui/spice-display.h:
#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
#define SPACE_ATTACH_WORKER_MANDATORY
#endif
Then use #ifdef SPACE_ATTACH_WORKER_MANDATORY in the source files?
Regardless:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
>
> trace_qxl_interface_attach_worker(qxl->id);
> }
> +#endif
>
> static void interface_set_compression_level(QXLInstance *sin, int level)
> {
> @@ -1156,7 +1158,9 @@ static const QXLInterface qxl_interface = {
> .base.major_version = SPICE_INTERFACE_QXL_MAJOR,
> .base.minor_version = SPICE_INTERFACE_QXL_MINOR,
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> .attache_worker = interface_attach_worker,
> +#endif
> .set_compression_level = interface_set_compression_level,
> #if SPICE_NEEDS_SET_MM_TIME
> .set_mm_time = interface_set_mm_time,
> diff --git a/ui/spice-display.c b/ui/spice-display.c
> index 19632fdf6c..811936ff7f 100644
> --- a/ui/spice-display.c
> +++ b/ui/spice-display.c
> @@ -500,10 +500,12 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
>
> /* spice display interface callbacks */
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> /* nothing to do */
> }
> +#endif
>
> static void interface_set_compression_level(QXLInstance *sin, int level)
> {
> @@ -709,7 +711,9 @@ static const QXLInterface dpy_interface = {
> .base.major_version = SPICE_INTERFACE_QXL_MAJOR,
> .base.minor_version = SPICE_INTERFACE_QXL_MINOR,
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> .attache_worker = interface_attach_worker,
> +#endif
> .set_compression_level = interface_set_compression_level,
> #if SPICE_NEEDS_SET_MM_TIME
> .set_mm_time = interface_set_mm_time,
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spice: remove obsolete callback
2020-09-18 10:07 [PATCH] spice: remove obsolete callback marcandre.lureau
2020-09-18 10:19 ` Philippe Mathieu-Daudé
@ 2020-09-18 11:24 ` Frediano Ziglio
2020-09-21 8:02 ` Gerd Hoffmann
2 siblings, 0 replies; 4+ messages in thread
From: Frediano Ziglio @ 2020-09-18 11:24 UTC (permalink / raw)
To: marcandre lureau; +Cc: qemu-devel, kraxel
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The "attach_worker" callbacks aren't doing anything in QEMU, but they
> were mandatory until Spice server commit
> 6aa1a17c69dc3cc02f338a78b3266e4c00ea1c1a ("spice-qxl: Remove QXLWorker
> definition").
>
> Furthermore, the old spelling is deprecated since commit
> 974692bda1e77af92b71ed43b022439448492cb9 ("spice-qxl: Fix typo in
> callback name and remove obsolete parameter")
>
> Compile that code out if Spice server version is recent enough.
>
> Fix compiler deprecation warnings with Spice > 0.14.3 (not released
> yet). We may want to wait until newer version is actually released to
> apply the patch.
>
You could use
#if SPICE_SERVER_VERSION <= 0x000e03 /* release 0.14.3 */
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> hw/display/qxl.c | 4 ++++
> ui/spice-display.c | 4 ++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 11871340e7..a02072dee0 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -518,12 +518,14 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct
> QXLCommandExt *ext)
>
> /* spice display interface callbacks */
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
>
> trace_qxl_interface_attach_worker(qxl->id);
> }
> +#endif
>
> static void interface_set_compression_level(QXLInstance *sin, int level)
> {
> @@ -1156,7 +1158,9 @@ static const QXLInterface qxl_interface = {
> .base.major_version = SPICE_INTERFACE_QXL_MAJOR,
> .base.minor_version = SPICE_INTERFACE_QXL_MINOR,
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> .attache_worker = interface_attach_worker,
> +#endif
For 0.14.4 you can provide .attached_worker instead, even if version used would
be downgraded will work. Same function could be used (with a cast) for attache_worker.
It depends on the usefulness of the trace call.
> .set_compression_level = interface_set_compression_level,
> #if SPICE_NEEDS_SET_MM_TIME
> .set_mm_time = interface_set_mm_time,
> diff --git a/ui/spice-display.c b/ui/spice-display.c
> index 19632fdf6c..811936ff7f 100644
> --- a/ui/spice-display.c
> +++ b/ui/spice-display.c
> @@ -500,10 +500,12 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay
> *ssd)
>
> /* spice display interface callbacks */
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> /* nothing to do */
> }
> +#endif
>
> static void interface_set_compression_level(QXLInstance *sin, int level)
> {
> @@ -709,7 +711,9 @@ static const QXLInterface dpy_interface = {
> .base.major_version = SPICE_INTERFACE_QXL_MAJOR,
> .base.minor_version = SPICE_INTERFACE_QXL_MINOR,
>
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> .attache_worker = interface_attach_worker,
> +#endif
> .set_compression_level = interface_set_compression_level,
> #if SPICE_NEEDS_SET_MM_TIME
> .set_mm_time = interface_set_mm_time,
Frediano
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spice: remove obsolete callback
2020-09-18 10:07 [PATCH] spice: remove obsolete callback marcandre.lureau
2020-09-18 10:19 ` Philippe Mathieu-Daudé
2020-09-18 11:24 ` Frediano Ziglio
@ 2020-09-21 8:02 ` Gerd Hoffmann
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2020-09-21 8:02 UTC (permalink / raw)
To: marcandre.lureau; +Cc: qemu-devel, fziglio
Hi,
> Fix compiler deprecation warnings with Spice > 0.14.3 (not released
> yet). We may want to wait until newer version is actually released to
> apply the patch.
Probably makes sense, just in case. It's not like this is an urgent
fix.
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
>
> trace_qxl_interface_attach_worker(qxl->id);
> }
> +#endif
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
> {
> /* nothing to do */
> }
> +#endif
While being at it, can we also drop one of the dummy callbacks?
The tracepoint can go away too I think, given qemu doesn't do anything
in the callback anyway.
> +#if SPICE_SERVER_VERSION < 0x000e04 /* release 0.14.4 */
> .attache_worker = interface_attach_worker,
> +#endif
> .set_compression_level = interface_set_compression_level,
> #if SPICE_NEEDS_SET_MM_TIME
> .set_mm_time = interface_set_mm_time,
Add a SPICE_NEEDS_ATTACH_WORKER #define for consistency?
take care,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-21 8:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18 10:07 [PATCH] spice: remove obsolete callback marcandre.lureau
2020-09-18 10:19 ` Philippe Mathieu-Daudé
2020-09-18 11:24 ` Frediano Ziglio
2020-09-21 8:02 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).