[libvirt] [PATCH] Don't overwrite error message during VM cleanup

Eric Blake eblake at redhat.com
Tue Nov 1 16:36:06 UTC 2011


On 11/01/2011 10:28 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"<berrange at redhat.com>
>
> If an LXC VM fails to start, quite a few cleanup paths will
> result in the original error message being overwritten. Some
> other cleanup paths also forgot to actually terminate the VM.
>
> * src/lxc/lxc_driver.c: Ensure VM is terminated on startup
>    failure and preserve original error
> ---
>   src/lxc/lxc_driver.c |   29 +++++++++++++++++++++--------
>   1 files changed, 21 insertions(+), 8 deletions(-)

>   cleanup:
> +    if (rc != 0&&  !err)
> +        err = virSaveLastError();
> +    VIR_WARN("Cleanup %s" , err&&  err->message ? err->message : NULL);

Use "(null)", not NULL, here (printf("%s",NULL) isn't portable).

ACK with that fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list