Re: [libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Richard W.M. Jones
On Fri, Sep 21, 2012 at 01:00:26PM +0100, Daniel P. Berrange wrote: > On Fri, Sep 21, 2012 at 12:54:25PM +0100, Richard W.M. Jones wrote: > > > > On Fri, Sep 21, 2012 at 10:39:19AM +0100, Daniel P. Berrange wrote: > > > From: "Daniel P. Berrange" > > > > > > SELinux wants all log files opened wi

Re: [libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Daniel P. Berrange
On Fri, Sep 21, 2012 at 12:54:25PM +0100, Richard W.M. Jones wrote: > > On Fri, Sep 21, 2012 at 10:39:19AM +0100, Daniel P. Berrange wrote: > > From: "Daniel P. Berrange" > > > > SELinux wants all log files opened with O_APPEND. When > > running non-root though, libvirtd likes to use O_TRUNC > >

Re: [libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Richard W.M. Jones
On Fri, Sep 21, 2012 at 10:39:19AM +0100, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > SELinux wants all log files opened with O_APPEND. When > running non-root though, libvirtd likes to use O_TRUNC > to avoid log files growing in size indefinitely. Instead > of using O_TRUNC thoug

Re: [libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Jiri Denemark
On Fri, Sep 21, 2012 at 10:39:19 +0100, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > SELinux wants all log files opened with O_APPEND. When > running non-root though, libvirtd likes to use O_TRUNC > to avoid log files growing in size indefinitely. Instead > of using O_TRUNC though,

Re: [libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Michal Privoznik
On 21.09.2012 11:39, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > SELinux wants all log files opened with O_APPEND. When > running non-root though, libvirtd likes to use O_TRUNC > to avoid log files growing in size indefinitely. Instead > of using O_TRUNC though, we can use O_APPEND

[libvirt] [PATCH] Don't use O_TRUNC when opening QEMU logfiles

2012-09-21 Thread Daniel P. Berrange
From: "Daniel P. Berrange" SELinux wants all log files opened with O_APPEND. When running non-root though, libvirtd likes to use O_TRUNC to avoid log files growing in size indefinitely. Instead of using O_TRUNC though, we can use O_APPEND and then call ftruncate() which keeps SELinux happier. Si