On 22/12/2015 19:17, Daniel P. Berrange wrote:
> +    if (common->has_logfile) {
> +        int flags = O_WRONLY | O_CREAT;
> +        if (!common->has_logappend ||
> +            !common->logappend) {
> +            flags |= O_TRUNC;
> +        }

Should it use O_APPEND if logappend is absent or true, or perhaps
always?  I can take care of the change myself.

You are also missing a few qemu_chr_alloc calls outside qemu-char.c,
which makes me wonder if it's better to add the new logic in
qemu_chr_alloc itself.

Paolo

> +        chr->logfd = qemu_open(common->logfile, flags, 0666);
> +        if (chr->logfd < 0) {
> +            error_setg_errno(errp, errno,
> +                             "Unable to open logfile %s",
> +                             common->logfile);
> +            return -1;
> +        }
> +    }
> +
> +    return 0;
> +}

Reply via email to