diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-02-21 12:06:55 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-21 14:09:17 +0100 |
commit | 83f7180227a4c383e00fcbc0c079805557a657c8 (patch) | |
tree | c944faff2a98c8c585eb5276ec932fa6d22adb3e /ui | |
parent | a2dc3c8ecb5c1c5c42dec9ce76db3832a65128ac (diff) |
spice: avoid spice runtime assert
The Spice server doesn't like to be started or stopped twice . It
aborts with:
(process:6191): Spice-ERROR **: 19:29:35.912: red-worker.c:623:handle_dev_start: assertion `!worker->running' failed
It's easy to avoid that situation since qemu spice_display_is_running
tracks the server state.
After the commit "spice: do not stop spice if VM is paused", it will
be possible to pause and resume the VM, and this will call
qemu_spice_display_start() twice. The easiest is to add a check for
spice_display_is_running with this patch to avoid the assert.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Victor Toso <victortoso@redhat.com>
Message-id: 20190221110703.5775-4-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/spice-core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c index 37fae3c424..784fddff7d 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -972,12 +972,20 @@ int qemu_spice_display_add_client(int csock, int skipauth, int tls) void qemu_spice_display_start(void) { + if (spice_display_is_running) { + return; + } + spice_display_is_running = true; spice_server_vm_start(spice_server); } void qemu_spice_display_stop(void) { + if (!spice_display_is_running) { + return; + } + spice_server_vm_stop(spice_server); spice_display_is_running = false; } |