[Spice-commits] 2 commits - server/cursor-channel.c server/red-parse-qxl.c server/red-parse-qxl.h server/red-worker.c

Christophe Fergau teuf at kemper.freedesktop.org
Mon Apr 16 10:10:52 UTC 2018


 server/cursor-channel.c |    8 ++++----
 server/red-parse-qxl.c  |    4 ++++
 server/red-parse-qxl.h  |    1 +
 server/red-worker.c     |    2 +-
 4 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 050c1f55ab446c1c45bbb16f8349540fcd24e7a9
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Apr 11 13:13:45 2018 +0200

    cursor: Rename cursor_marshall to red_marshall_cursor
    
    The name is more consistent with red_marshall_cursor_init.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 522261e3..ada1d62a 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -142,9 +142,9 @@ static void red_marshall_cursor_init(CursorChannelClient *ccc, SpiceMarshaller *
     spice_marshall_msg_cursor_init(base_marshaller, &msg);
 }
 
-static void cursor_marshall(CursorChannelClient *ccc,
-                            SpiceMarshaller *m,
-                            RedCursorPipeItem *cursor_pipe_item)
+static void red_marshall_cursor(CursorChannelClient *ccc,
+                                SpiceMarshaller *m,
+                                RedCursorPipeItem *cursor_pipe_item)
 {
     RedChannelClient *rcc = RED_CHANNEL_CLIENT(ccc);
     CursorChannel *cursor_channel = CURSOR_CHANNEL(red_channel_client_get_channel(rcc));
@@ -212,7 +212,7 @@ static void cursor_channel_send_item(RedChannelClient *rcc, RedPipeItem *pipe_it
 
     switch (pipe_item->type) {
     case RED_PIPE_ITEM_TYPE_CURSOR:
-        cursor_marshall(ccc, m, SPICE_UPCAST(RedCursorPipeItem, pipe_item));
+        red_marshall_cursor(ccc, m, SPICE_UPCAST(RedCursorPipeItem, pipe_item));
         break;
     case RED_PIPE_ITEM_TYPE_INVAL_ONE:
         red_marshall_inval(rcc, m, SPICE_CONTAINEROF(pipe_item, RedCacheItem, u.pipe_data));
commit b547919190a6e1615b6ac4ba779210211a120135
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 10 17:32:48 2018 +0200

    cursor: Delay release of QXL guest cursor resources
    
    There's an implicit API/ABI contract between QEMU and SPICE that SPICE
    will keep the guest QXL resources alive as long as QEMU can hold a
    pointer to them. This implicit contract was broken in 1c6e7cf7 "Release
    cursor as soon as possible", causing crashes at migration time.
    While the proper fix would be in QEMU so that spice-server does not need
    to have that kind of knowledge regarding QEMU internal implementation,
    this commit reverts to the pre-1c6e7cf7 behaviour to avoid a regression
    while QEMU is being fixed.
    
    This version of the fix is based on a suggestion from Frediano Ziglio.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540919
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c
index d0e7eb71..9f1303da 100644
--- a/server/red-parse-qxl.c
+++ b/server/red-parse-qxl.c
@@ -24,6 +24,7 @@
 #include <common/lz_common.h>
 #include "spice-bitmap-utils.h"
 #include "red-common.h"
+#include "red-qxl.h"
 #include "memslot.h"
 #include "red-parse-qxl.h"
 
@@ -1497,4 +1498,7 @@ void red_put_cursor_cmd(RedCursorCmd *red)
         red_put_cursor(&red->u.set.shape);
         break;
     }
+    if (red->qxl) {
+        red_qxl_release_resource(red->qxl, red->release_info_ext);
+    }
 }
diff --git a/server/red-parse-qxl.h b/server/red-parse-qxl.h
index ce7d8b05..a33f36ad 100644
--- a/server/red-parse-qxl.h
+++ b/server/red-parse-qxl.h
@@ -99,6 +99,7 @@ typedef struct RedSurfaceCmd {
 } RedSurfaceCmd;
 
 typedef struct RedCursorCmd {
+    QXLInstance *qxl;
     QXLReleaseInfoExt release_info_ext;
     uint8_t type;
     union {
diff --git a/server/red-worker.c b/server/red-worker.c
index 387f500e..eb927f3e 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -118,7 +118,7 @@ static gboolean red_process_cursor_cmd(RedWorker *worker, const QXLCommandExt *e
         g_free(cursor_cmd);
         return FALSE;
     }
-    red_qxl_release_resource(worker->qxl, cursor_cmd->release_info_ext);
+    cursor_cmd->qxl = worker->qxl;
     cursor_channel_process_cmd(worker->cursor_channel, cursor_cmd);
     return TRUE;
 }


More information about the Spice-commits mailing list