On a %A in %Y, Peter Krempa wrote:
The submission of the event to the helper thread has a verbose
cleanup
path which was duplicated in all the event handlers. Simplify it by
extracting the code into a helper named 'qemuProcessEventSubmit' and
reuse it where appropriate.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 113 +++++++++++++++-------------------------
1 file changed, 43 insertions(+), 70 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1bdfbce697..4c1130945f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1740,11 +1722,8 @@ qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon
G_GNUC_UNUSED,
processEvent->eventType = QEMU_PROCESS_EVENT_PR_DISCONNECT;
processEvent->vm = virObjectRef(vm);
- if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
- qemuProcessEventFree(processEvent);
- virObjectUnref(vm);
- goto cleanup;
- }
+ qemuProcessEventSubmit(driver, &processEvent);
+
cleanup:
virObjectUnlock(vm);
Extra newline.
Jano