[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] libxl: open logs with O_APPEND



Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: open logs with 
O_APPEND"):
> On Mon, 2011-11-28 at 12:28 +0000, Ian Jackson wrote:
> > Logfiles should always be opened for append.
> > 
> > Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> 
> Both this and the 2/2 patch look sensible to me and are:
> 
> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Thanks.  I will apply then.

> > -        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT, 0644) )<0);
> > +        CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
> > +                                   0644) )<0);
> 
> fullname here came from libxl_create_logfile so has been rotated such
> that the file will be empty. I don't think O_APPEND is harmful or wrong
> given this though.

O_APPEND sets a flag which applies throughout the future life of the
open-file, so that even if the file later grows for some reason,
writes will never overwrite existing data.

> Do we need to arrange for libxl_create_logfile to be called for some of
> these others though?

The one in libxl_create_device_model came from libxl_create_logfile
too.

Obviously the one in qemu can't call libxl_create_logfile but in our
setup it's fed /dev/stderr anyway.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.