* [Qemu-devel] [PATCH 1/3] spice: move qemu_spice_display_*() from spice-graphics to spice-core
@ 2013-12-10 8:12 Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 2/3] spice: move spice_server_vm_{start, stop} calls into qemu_spice_display_*() Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 3/3] spice: stop server for qxl hard reset Gerd Hoffmann
0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2013-12-10 8:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 16 ++++++++++++++++
ui/spice-display.c | 17 -----------------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 9fb9544..0c48156 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -47,6 +47,7 @@ static const char *auth = "spice";
static char *auth_passwd;
static time_t auth_expires = TIME_MAX;
static int spice_migration_completed;
+static int spice_display_is_running;
int using_spice = 0;
static QemuThread me;
@@ -904,6 +905,21 @@ int qemu_spice_display_add_client(int csock, int skipauth, int tls)
}
}
+void qemu_spice_display_start(void)
+{
+ spice_display_is_running = true;
+}
+
+void qemu_spice_display_stop(void)
+{
+ spice_display_is_running = false;
+}
+
+int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
+{
+ return spice_display_is_running;
+}
+
static void spice_register_config(void)
{
qemu_add_opts(&qemu_spice_opts);
diff --git a/ui/spice-display.c b/ui/spice-display.c
index f23a318..9bb42f1 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -126,23 +126,6 @@ void qemu_spice_wakeup(SimpleSpiceDisplay *ssd)
spice_qxl_wakeup(&ssd->qxl);
}
-static int spice_display_is_running;
-
-void qemu_spice_display_start(void)
-{
- spice_display_is_running = true;
-}
-
-void qemu_spice_display_stop(void)
-{
- spice_display_is_running = false;
-}
-
-int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
-{
- return spice_display_is_running;
-}
-
static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
QXLRect *rect)
{
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/3] spice: move spice_server_vm_{start, stop} calls into qemu_spice_display_*()
2013-12-10 8:12 [Qemu-devel] [PATCH 1/3] spice: move qemu_spice_display_*() from spice-graphics to spice-core Gerd Hoffmann
@ 2013-12-10 8:12 ` Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 3/3] spice: stop server for qxl hard reset Gerd Hoffmann
1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2013-12-10 8:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori
So calling spice server to start/stop the worker goes
hand in hand with the status variable update.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 0c48156..4cce3b3 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -623,9 +623,7 @@ static void vm_change_state_handler(void *opaque, int running,
{
if (running) {
qemu_spice_display_start();
- spice_server_vm_start(spice_server);
} else {
- spice_server_vm_stop(spice_server);
qemu_spice_display_stop();
}
}
@@ -908,10 +906,12 @@ int qemu_spice_display_add_client(int csock, int skipauth, int tls)
void qemu_spice_display_start(void)
{
spice_display_is_running = true;
+ spice_server_vm_start(spice_server);
}
void qemu_spice_display_stop(void)
{
+ spice_server_vm_stop(spice_server);
spice_display_is_running = false;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 3/3] spice: stop server for qxl hard reset
2013-12-10 8:12 [Qemu-devel] [PATCH 1/3] spice: move qemu_spice_display_*() from spice-graphics to spice-core Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 2/3] spice: move spice_server_vm_{start, stop} calls into qemu_spice_display_*() Gerd Hoffmann
@ 2013-12-10 8:12 ` Gerd Hoffmann
1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2013-12-10 8:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hard reset can happen at any time. We should be able to put qxl into a
known-good state no matter what. Stop spice server thread for reset so
it can't be confused by fetching stale commands lingering around in the
rings while we reset is ongoing.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/qxl.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index efdefd6..e4f172e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1144,8 +1144,14 @@ static void qxl_soft_reset(PCIQXLDevice *d)
static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)
{
+ bool startstop = qemu_spice_display_is_running(&d->ssd);
+
trace_qxl_hard_reset(d->id, loadvm);
+ if (startstop) {
+ qemu_spice_display_stop();
+ }
+
qxl_spice_reset_cursor(d);
qxl_spice_reset_image_cache(d);
qxl_reset_surfaces(d);
@@ -1159,6 +1165,10 @@ static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)
}
qemu_spice_create_host_memslot(&d->ssd);
qxl_soft_reset(d);
+
+ if (startstop) {
+ qemu_spice_display_start();
+ }
}
static void qxl_reset_handler(DeviceState *dev)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-10 8:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 8:12 [Qemu-devel] [PATCH 1/3] spice: move qemu_spice_display_*() from spice-graphics to spice-core Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 2/3] spice: move spice_server_vm_{start, stop} calls into qemu_spice_display_*() Gerd Hoffmann
2013-12-10 8:12 ` [Qemu-devel] [PATCH 3/3] spice: stop server for qxl hard reset 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).