From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chardev backends
Date: Wed, 23 Dec 2015 12:34:25 +0100 [thread overview]
Message-ID: <567A86C1.7020907@redhat.com> (raw)
In-Reply-To: <1450808260-17922-1-git-send-email-berrange@redhat.com>
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;
> +}
next prev parent reply other threads:[~2015-12-23 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-22 18:17 [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chardev backends Daniel P. Berrange
2015-12-22 18:45 ` Eric Blake
2015-12-23 11:24 ` Daniel P. Berrange
2015-12-23 15:41 ` Eric Blake
2015-12-22 19:07 ` Eric Blake
2015-12-23 11:32 ` Daniel P. Berrange
2015-12-23 15:45 ` Eric Blake
2015-12-23 11:34 ` Paolo Bonzini [this message]
2015-12-23 11:43 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567A86C1.7020907@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.