[Spice-devel] [RFC PATCH spice-server v3 17/20] WIP cursor-channel: Allow to not handle a QXL device

Frediano Ziglio fziglio at redhat.com
Wed Aug 23 09:14:35 UTC 2017


TODO: not a constant ID.
Christophe F was preparing a patch to get rid of the
qxl parameter to the CursorChannel.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/cursor-channel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 63d6886d..831c81e6 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -94,7 +94,9 @@ static void cursor_item_unref(CursorItem *item)
         return;
 
     cursor_cmd = item->red_cursor;
-    red_qxl_release_resource(item->qxl, cursor_cmd->release_info_ext);
+    if (item->qxl) {
+        red_qxl_release_resource(item->qxl, cursor_cmd->release_info_ext);
+    }
     red_put_cursor_cmd(cursor_cmd);
     free(cursor_cmd);
 
@@ -297,7 +299,7 @@ CursorChannel* cursor_channel_new(RedsState *server, QXLInstance *qxl,
                         "spice-server", server,
                         "core-interface", core,
                         "channel-type", SPICE_CHANNEL_CURSOR,
-                        "id", qxl->id,
+                        "id", qxl ? qxl->id : 1,
                         "migration-flags", 0,
                         "qxl", qxl,
                         "handle-acks", TRUE,
-- 
2.13.5



More information about the Spice-devel mailing list