[libvirt] [PATCH 3/3] lxc: driver: Improve logging when launching emulator

Eric Blake eblake at redhat.com
Thu May 5 21:32:06 UTC 2011


On 05/05/2011 02:44 PM, Cole Robinson wrote:
> Log the full command line and a timestamp like we do for QEMU
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/lxc/lxc_driver.c |   23 +++++++++++++++++++++++
>  1 files changed, 23 insertions(+), 0 deletions(-)
> 

>  
> +    /* Log timestamp */
> +    if ((timestamp = virTimestamp()) == NULL) {
> +        virReportOOMError();
> +        goto cleanup;
> +    }
> +    if (safewrite(logfile, timestamp, strlen(timestamp)) < 0 ||
> +        safewrite(logfile, START_POSTFIX, strlen(START_POSTFIX)) < 0) {
> +        VIR_WARN("Unable to write timestamp to logfile: %s",
> +                 virStrerror(errno, ebuf, sizeof ebuf));
> +    }
> +    VIR_FREE(timestamp);

Hmm, I know you just copied qemu_process.c, but should we be doing best
effort to proceed (and just skip the timestamp output) if we are low on
memory, rather than flat out giving up?  But changing that should be a
separate patch, since qemu should also be changed, so:

ACK.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110505/0e75a514/attachment-0001.sig>


More information about the libvir-list mailing list