From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhgf-0006jo-4Y for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:34:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBhgb-0003oc-VX for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:34:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhgb-0003oS-QI for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:34:29 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 7671DAACCC for ; Wed, 23 Dec 2015 11:34:29 +0000 (UTC) References: <1450808260-17922-1-git-send-email-berrange@redhat.com> From: Paolo Bonzini Message-ID: <567A86C1.7020907@redhat.com> Date: Wed, 23 Dec 2015 12:34:25 +0100 MIME-Version: 1.0 In-Reply-To: <1450808260-17922-1-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chardev backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org On 22/12/2015 19:17, Daniel P. Berrange wrote: > + if (common->has_logfile) { > + int flags =3D O_WRONLY | O_CREAT; > + if (!common->has_logappend || > + !common->logappend) { > + flags |=3D 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 =3D 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; > +}