From: Ian Campbell Subject: Re: [PATCH 2/2] qemu-dm: open char devices "file:..." with O_APPEND Date: Mon, 28 Nov 2011 17:57:36 +0000 Message-ID: <1322503056.11846.28.camel@dagon.hellion.org.uk> References: <20179.32337.102834.867932@mariner.uk.xensource.com> <20179.32458.436431.927443@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20179.32458.436431.927443@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2011-11-28 at 12:30 +0000, Ian Jackson wrote: > The "file:..." character open method is used by serial and parallel > ports, to divert the output to a file (and these devices never produce > any input). This is like a logfile, and so should be opened for > append. > > In qemu-xen-unstable, this is used only for the qemu stderr by libxl. Do we need a similar patch for qemu upstream? > > Signed-off-by: Ian Jackson > > diff --git a/qemu-char.c b/qemu-char.c > index 35e428d..324ed16 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -588,7 +588,7 @@ static CharDriverState *qemu_chr_open_file_out(const char *file_out) > { > int fd_out; > > - TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666)); > + TFR(fd_out = open(file_out, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | O_APPEND, 0666)); > if (fd_out < 0) > return NULL; > return qemu_chr_open_fd(-1, fd_out); > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel