[PATCH 2/2] qemu: Warn on possibly incorrect usage of EnterMonitor*

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

 



qemuDomainObjEnterMonitor{,WithDriver} should not be called from async
jobs, only EnterMonitorAsync variant is allowed.
---
 src/qemu/qemu_domain.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7f1f8ee..4dda2e0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -975,6 +975,9 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
                             _("unexpected async job %d"), asyncJob);
             return -1;
         }
+        if (priv->job.asyncOwner != virThreadSelfID())
+            VIR_WARN("This thread doesn't seem to be the async job owner: %d",
+                     priv->job.asyncOwner);
         if (qemuDomainObjBeginJobInternal(driver, driver_locked, obj,
                                           QEMU_JOB_ASYNC_NESTED,
                                           QEMU_ASYNC_JOB_NONE) < 0)
@@ -986,6 +989,9 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
             ignore_value(qemuDomainObjEndJob(driver, obj));
             return -1;
         }
+    } else if (priv->job.asyncOwner == virThreadSelfID()) {
+        VIR_WARN("This thread seems to be the async job owner; entering"
+                 " monitor without asking for a nested job is dangerous");
     }
 
     qemuMonitorLock(priv->mon);
-- 
1.7.8.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]