From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhp4-0001la-UO for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:43:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBhp0-0006Ht-QV for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:43:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhp0-0006Hl-LB for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:43:10 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3938B19FF91 for ; Wed, 23 Dec 2015 11:43:10 +0000 (UTC) Date: Wed, 23 Dec 2015 11:43:06 +0000 From: "Daniel P. Berrange" Message-ID: <20151223114306.GI20028@redhat.com> References: <1450808260-17922-1-git-send-email-berrange@redhat.com> <567A86C1.7020907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <567A86C1.7020907@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] qemu-char: add logfile facility to all chardev backends Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Wed, Dec 23, 2015 at 12:34:25PM +0100, Paolo Bonzini wrote: > > > 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. Yes it should use O_APPEND in the other branch of the if, that's a bug eric pointed out too. Basically same logic as the recently added 'append' flag in qmp_chardev_open_file > 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. Oh, yes, perhaps I should just pass ChardevCommon straight into qemu_chr_alloc(). I'll look at that when doing the other changes Eric suggested wrt to removing use of backend.u.data Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|