[PATCH v2] qemu: fix locking in qemuProcessHandleMemoryFailure
Fix locking in qemuProcessHandleMemoryFailure. We use a lock guard now because we can directly return from the default switch cases. Issue has been discovered by johannes.kulik@sap.com On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de> --- src/qemu/qemu_process.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4e1d713809..a53bb40783 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1939,8 +1939,8 @@ qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED, virDomainMemoryFailureRecipientType recipient; virDomainMemoryFailureActionType action; unsigned int flags = 0; + VIR_LOCK_GUARD lock = virObjectLockGuard(vm); - virObjectLock(vm); driver = QEMU_DOMAIN_PRIVATE(vm)->driver; switch (mfp->recipient) { @@ -1980,8 +1980,6 @@ qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED, event = virDomainEventMemoryFailureNewFromObj(vm, recipient, action, flags); - virObjectUnlock(vm); - virObjectEventStateQueue(driver->domainEventState, event); } -- 2.52.0
On 1/8/26 15:03, Thomas Prescher wrote:
Fix locking in qemuProcessHandleMemoryFailure. We use a lock guard now because we can directly return from the default switch cases.
Issue has been discovered by johannes.kulik@sap.com
On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de> --- src/qemu/qemu_process.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Ah, sorry. Should have been more specific in my earlier review. When I gave this my Reviewed-by I also pushed it: https://gitlab.com/libvirt/libvirt/-/commit/871a8f872d434c21c7e8f339e4a9d49e... Michal
participants (2)
-
Michal Prívozník -
Thomas Prescher