Re: [PATCH 33/33] qemu: process: Extract code for submitting event handling to separate thread

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

 



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@xxxxxxxxxx>
> ---
>  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




[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