[PATCH 2/2] qemuProcessHandleMemoryDeviceSizeChange: Use qemuProcessEventSubmit()

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

 



This is a typical example of what can go wrong when sending out
an old patch. Back in January, when I was writing
qemuProcessHandleMemoryDeviceSizeChange() events were sent to the
worker pool thread using virThreadPoolSendJob(). Then, in July a
helper was introduced (qemuProcessEventSubmit()) but since my
code was not committed and I did not pay attention my code wasn't
updated. Later, when I merged my code it uses the old approach.

BTW: this also fixes a possible double free which I completely
missed when writing the code ~10 months ago.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2a1fcad1ee..d5f8a47ac2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1870,15 +1870,8 @@ qemuProcessHandleMemoryDeviceSizeChange(qemuMonitor *mon G_GNUC_UNUSED,
     processEvent->vm = virObjectRef(vm);
     processEvent->data = g_steal_pointer(&info);
 
-    if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
-        qemuProcessEventFree(processEvent);
-        virObjectUnref(vm);
-        goto cleanup;
-    }
+    qemuProcessEventSubmit(driver, &processEvent);
 
-    processEvent = NULL;
- cleanup:
-    qemuProcessEventFree(processEvent);
     virObjectUnlock(vm);
 }
 
-- 
2.32.0




[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]

  Powered by Linux