]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuhotplugtest: Fix misleading comment on monitor unlock
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Apr 2023 15:59:02 +0000 (17:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 Apr 2023 06:46:27 +0000 (08:46 +0200)
There's a comment in testQemuHotplug() trying to explain why we
need to unlock the monitor object. Well, while it might have been
correct when being introduced, it's no longer factually correct
as just any function (attach/detach/update) might talk to the
monitor and it expects the monitor to be unlocked (as it calls
qemuDomainObjEnterMonitor() + qemuDomainObjExitMonitor()).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
tests/qemuhotplugtest.c

index 341fcf40df41f6aa314bfb6bf3210e44b60f5345..635f5a39bd1975c11470b89850bec179cc8700f3 100644 (file)
@@ -223,9 +223,8 @@ testQemuHotplug(const void *data)
     priv = vm->privateData;
     priv->mon = qemuMonitorTestGetMonitor(test_mon);
 
-    /* XXX We need to unlock the monitor here, as
-     * qemuDomainObjEnterMonitorInternal (called from qemuDomainChangeGraphics)
-     * tries to lock it again */
+    /* We need to unlock the monitor here, as any function below talks
+     * (transitively) on the monitor. */
     virObjectUnlock(priv->mon);
 
     switch (test->action) {