[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chard
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chardev backends |
Date: |
Wed, 23 Dec 2015 12:34:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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;
> +}