]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't use O_TRUNC when opening QEMU logfiles
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 21 Sep 2012 09:37:53 +0000 (10:37 +0100)
committerCole Robinson <crobinso@redhat.com>
Wed, 17 Oct 2012 20:41:42 +0000 (16:41 -0400)
commita8ad93965f8e96338f4e9ca7557b30ac417fe82b
tree88e22c4c4bef9bf1b0d39fca619f9e32ea5925b6
parentf4e3a2afa5ebd1d07fd523421997940d7cd8664b
Don't use O_TRUNC when opening QEMU logfiles

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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 639d5c4966478d28a96bf06f2ccc9ef6418f4736)
src/qemu/qemu_domain.c