[spice PATCH 5.5/55] spice_server_vm_start/stop: notify red_dispatcher on vm start/stop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Till now, red_worker was notfied about vm status changes via QXLWorker->start/stop
(or spice_qxl_start/stop).
Newer qemu, that supports calling spice_server_vm_start/stop, will call only
these routines, and won't call QXLWorker->start/stop.
---
addition patch to the seamless migration series

 server/red_dispatcher.c |   22 ++++++++++++++++++++++
 server/red_dispatcher.h |    2 ++
 server/reds.c           |    2 ++
 server/spice.h          |    6 ++++--
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 8d9c073..69d4f0a 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -762,6 +762,28 @@ void red_dispatcher_set_mouse_mode(uint32_t mode)
     }
 }
 
+void red_dispatcher_on_vm_stop(void)
+{
+    RedDispatcher *now = dispatchers;
+
+    spice_debug(NULL);
+    while (now) {
+        red_dispatcher_stop(now);
+        now = now->next;
+    }
+}
+
+void red_dispatcher_on_vm_start(void)
+{
+    RedDispatcher *now = dispatchers;
+
+    spice_debug(NULL);
+    while (now) {
+        red_dispatcher_start(now);
+        now = now->next;
+    }
+}
+
 int red_dispatcher_count(void)
 {
     RedDispatcher *now = dispatchers;
diff --git a/server/red_dispatcher.h b/server/red_dispatcher.h
index 98f8cea..7e9ffe6 100644
--- a/server/red_dispatcher.h
+++ b/server/red_dispatcher.h
@@ -27,6 +27,8 @@ void red_dispatcher_set_mm_time(uint32_t);
 void red_dispatcher_on_ic_change(void);
 void red_dispatcher_on_sv_change(void);
 void red_dispatcher_set_mouse_mode(uint32_t mode);
+void red_dispatcher_on_vm_stop(void);
+void red_dispatcher_on_vm_start(void);
 int red_dispatcher_count(void);
 int red_dispatcher_add_renderer(const char *name);
 uint32_t red_dispatcher_qxl_ram_size(void);
diff --git a/server/reds.c b/server/reds.c
index b0c609f..416dff4 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -4041,6 +4041,7 @@ SPICE_GNUC_VISIBLE void spice_server_vm_start(SpiceServer *s)
         st_item = SPICE_CONTAINEROF(item, SpiceCharDeviceStateItem, link);
         spice_char_device_start(st_item->st);
     }
+    red_dispatcher_on_vm_start();
 }
 
 SPICE_GNUC_VISIBLE void spice_server_vm_stop(SpiceServer *s)
@@ -4055,6 +4056,7 @@ SPICE_GNUC_VISIBLE void spice_server_vm_stop(SpiceServer *s)
         st_item = SPICE_CONTAINEROF(item, SpiceCharDeviceStateItem, link);
         spice_char_device_stop(st_item->st);
     }
+    red_dispatcher_on_vm_stop();
 }
 
 ssize_t reds_stream_read(RedsStream *s, void *buf, size_t nbyte)
diff --git a/server/spice.h b/server/spice.h
index 5f82ed5..fb51a47 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -134,8 +134,10 @@ struct QXLWorker {
 
 void spice_qxl_wakeup(QXLInstance *instance);
 void spice_qxl_oom(QXLInstance *instance);
-void spice_qxl_start(QXLInstance *instance);
-void spice_qxl_stop(QXLInstance *instance);
+void spice_qxl_start(QXLInstance *instance); /* deprecated since 0.11.2
+                                                spice_server_vm_start replaces it */
+void spice_qxl_stop(QXLInstance *instance);  /* deprecated since 0.11.2
+                                                spice_server_vm_stop replaces it */
 void spice_qxl_update_area(QXLInstance *instance, uint32_t surface_id,
                    struct QXLRect *area, struct QXLRect *dirty_rects,
                    uint32_t num_dirty_rects, uint32_t clear_dirty_region);
-- 
1.7.7.6

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]