[Qemu-devel] [PATCH 04/10] spice: avoid spice runtime assert

Marc-André Lureau posted 10 patches 7 years, 3 months ago
[Qemu-devel] [PATCH 04/10] spice: avoid spice runtime assert
Posted by Marc-André Lureau 7 years, 3 months ago
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.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/spice-core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 76896f7c7a..13f1c11b61 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -923,12 +923,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;
 }
-- 
2.18.0.547.g1d89318c48


Re: [Qemu-devel] [PATCH 04/10] spice: avoid spice runtime assert
Posted by Gerd Hoffmann 7 years, 2 months ago
On Fri, Aug 03, 2018 at 07:36:08PM +0200, Marc-André Lureau wrote:
> 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.

How do you trigger this?  qemu should not do that in the first place.

cheers,
  Gerd


Re: [Qemu-devel] [PATCH 04/10] spice: avoid spice runtime assert
Posted by Marc-André Lureau 6 years, 11 months ago
Hi
On Tue, Aug 7, 2018 at 5:48 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Fri, Aug 03, 2018 at 07:36:08PM +0200, Marc-André Lureau wrote:
> > 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.
>
> How do you trigger this?  qemu should not do that in the first place.

After "[PATCH 06/10] spice: do not stop spice if VM is paused ", you
can pause the VM and resume it (also through spice): it will call
qemu_spice_display_start() twice. The easiest seems to add a check for
spice_display_is_running, with this patch.

-- 
Marc-André Lureau