Use append to a truncated file to retain owner (#1677)

Change the default behaviour when logging output from the console to a
file to ensure the file is pre-created and unless append is explicitly
set to true in the source config, truncate the file. Combined with
having the domain template default to enabling append, this causes
libvirt/qemu to not attempt to create the file and thus retains the
owner/group and permissions of the original file.

Relates-to: #1385
This commit is contained in:
Darragh Bailey
2023-01-22 21:22:29 +00:00
committed by GitHub
parent 9aab9b7d03
commit 6b907ab6e0
3 changed files with 9 additions and 4 deletions

View File

@@ -105,7 +105,7 @@
<target dev='fda' bus='fdc'/>
</disk>
<serial type='file'>
<source path='/var/log/vm_consoles/machine.log'/>
<source path='/var/log/vm_consoles/machine.log' append='on'/>
<target port='0'/>
</serial>
<console type='file'>