[Spice-devel] [spice-server 09/10] Remove CursorItem::group_id

Christophe Fergeau cfergeau at redhat.com
Fri Feb 12 17:51:08 UTC 2016


Now that the group_id is known to RedCursorCmd, we don't need to store
it separately in CursorItem.
---
 server/cursor-channel.c | 10 +++-------
 server/cursor-channel.h |  3 +--
 server/red-worker.c     |  4 ++--
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index d9b6faa..0ab0d80 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -38,7 +38,6 @@ enum {
 
 typedef struct CursorItem {
     QXLInstance *qxl;
-    uint32_t group_id;
     int refs;
     RedCursorCmd *red_cursor;
 } CursorItem;
@@ -82,7 +81,7 @@ struct CursorChannelClient {
 #include "cache-item.tmpl.c"
 #undef CLIENT_CURSOR_CACHE
 
-static CursorItem *cursor_item_new(QXLInstance *qxl, RedCursorCmd *cmd, uint32_t group_id)
+static CursorItem *cursor_item_new(QXLInstance *qxl, RedCursorCmd *cmd)
 {
     CursorItem *cursor_item;
 
@@ -91,7 +90,6 @@ static CursorItem *cursor_item_new(QXLInstance *qxl, RedCursorCmd *cmd, uint32_t
     cursor_item = g_new0(CursorItem, 1);
     cursor_item->qxl = qxl;
     cursor_item->refs = 1;
-    cursor_item->group_id = group_id;
     cursor_item->red_cursor = cmd;
 
     return cursor_item;
@@ -477,8 +475,7 @@ CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor, RedClient
     return ccc;
 }
 
-void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd,
-                                uint32_t group_id)
+void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd)
 {
     CursorItem *cursor_item;
     int cursor_show = FALSE;
@@ -486,8 +483,7 @@ void cursor_channel_process_cmd(CursorChannel *cursor, RedCursorCmd *cursor_cmd,
     spice_return_if_fail(cursor);
     spice_return_if_fail(cursor_cmd);
 
-    cursor_item = cursor_item_new(cursor->common.qxl,
-                                  cursor_cmd, group_id);
+    cursor_item = cursor_item_new(cursor->common.qxl, cursor_cmd);
 
     switch (cursor_cmd->type) {
     case QXL_CURSOR_SET:
diff --git a/server/cursor-channel.h b/server/cursor-channel.h
index 104af20..967a117 100644
--- a/server/cursor-channel.h
+++ b/server/cursor-channel.h
@@ -34,8 +34,7 @@ CursorChannel*       cursor_channel_new         (RedWorker *worker);
 void                 cursor_channel_disconnect  (CursorChannel *cursor_channel);
 void                 cursor_channel_reset       (CursorChannel *cursor);
 void                 cursor_channel_init        (CursorChannel *cursor, CursorChannelClient* client);
-void                 cursor_channel_process_cmd (CursorChannel *cursor, RedCursorCmd *cursor_cmd,
-                                                 uint32_t group_id);
+void                 cursor_channel_process_cmd (CursorChannel *cursor, RedCursorCmd *cursor_cmd);
 void                 cursor_channel_set_mouse_mode(CursorChannel *cursor, uint32_t mode);
 
 CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
diff --git a/server/red-worker.c b/server/red-worker.c
index 2b5a06d..a498e20 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -174,7 +174,7 @@ static int red_process_cursor(RedWorker *worker, int *ring_is_empty)
                 break;
             }
 
-            cursor_channel_process_cmd(worker->cursor_channel, cursor, ext_cmd.group_id);
+            cursor_channel_process_cmd(worker->cursor_channel, cursor);
             break;
         }
         default:
@@ -1161,7 +1161,7 @@ static int loadvm_command(RedWorker *worker, QXLCommandExt *ext)
             free(cursor_cmd);
             return FALSE;
         }
-        cursor_channel_process_cmd(worker->cursor_channel, cursor_cmd, ext->group_id);
+        cursor_channel_process_cmd(worker->cursor_channel, cursor_cmd);
         break;
     case QXL_CMD_SURFACE:
         surface_cmd = spice_new0(RedSurfaceCmd, 1);
-- 
2.5.0



More information about the Spice-devel mailing list