]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
glib: Use safe glib event workaround in other event loops
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 4 Mar 2021 09:00:06 +0000 (10:00 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 5 Mar 2021 09:17:26 +0000 (10:17 +0100)
Similarly to the crash workaround:

  commit 0db4743645b7a0611a3c0687f834205c9956f7fc
  Author: Daniel P. BerrangĂ© <berrange@redhat.com>
  Date:   Tue Jul 28 16:52:47 2020 +0100

    util: avoid crash due to race in glib event loop code

we need to do this in the other event loop as crash in that one was also
reported:

  https://bugzilla.redhat.com/show_bug.cgi?id=1931331

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_agent.c
src/qemu/qemu_monitor.c

index 9a74b802b89d37675799db769158f7a0c8072221..8b880d0d157c1ae69f9da9c152df3f54c7adc3a3 100644 (file)
@@ -533,7 +533,7 @@ qemuAgentUnregister(qemuAgentPtr agent)
 {
     if (agent->watch) {
         g_source_destroy(agent->watch);
-        g_source_unref(agent->watch);
+        g_vir_source_unref_safe(agent->watch);
         agent->watch = NULL;
     }
 }
index 73f337a6be53cea17bf809bd8efd641ce2b1af7e..b4f2641504f8276ae8c354aa950f433c55e18059 100644 (file)
@@ -862,7 +862,7 @@ qemuMonitorUnregister(qemuMonitorPtr mon)
 {
     if (mon->watch) {
         g_source_destroy(mon->watch);
-        g_source_unref(mon->watch);
+        g_vir_source_unref_safe(mon->watch);
         mon->watch = NULL;
     }
 }