[libvirt] [PATCH v2 08/13] qemu: convert log file creation to use qemuDomainLogContextPtr

John Ferlan jferlan at redhat.com
Wed Nov 18 23:43:09 UTC 2015



On 11/12/2015 12:19 PM, Daniel P. Berrange wrote:
> Convert the places which create/open log files to use the new
> qemuDomainLogContextPtr object instead.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/qemu/qemu_domain.c  | 100 +++++-------------------------------------------
>  src/qemu/qemu_domain.h  |   2 -
>  src/qemu/qemu_process.c |  78 +++++++++++++++++--------------------
>  3 files changed, 46 insertions(+), 134 deletions(-)
> 

[...]

> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c

[...]

> @@ -4854,7 +4850,7 @@ int qemuProcessStart(virConnectPtr conn,
>  
>   cleanup:
>      virCommandFree(cmd);
> -    VIR_FORCE_CLOSE(logfile);
> +    qemuDomainLogContextFree(logCtxt);
>      virObjectUnref(cfg);
>      virObjectUnref(caps);
>      VIR_FREE(nicindexes);
> @@ -4868,6 +4864,9 @@ int qemuProcessStart(virConnectPtr conn,
>       * pretend we never started it */
>      if (priv->mon)
>          qemuMonitorSetDomainLog(priv->mon, -1, -1);
> +    /* Must close log now to allow ProcessSto to re-open it */

ProcessStop  (almost not worth mentioning ;-))

> +    qemuDomainLogContextFree(logCtxt);
> +    logCtxt = NULL;
>      qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, stop_flags);
>      goto cleanup;
>  

[...]

ACK

John




More information about the libvir-list mailing list