Mark svirt_image_t as a logfile to allow rotating VM serial logs #2888
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The svirt_image_t type is used for quite a variety of files, including the output of VM serial consoles that have been configured in libvirt to dump to a file.
These outputs are effectively just logs, and it is plausible that users will want to run things like logrotate on them. However, confined tools like logrotate require the log files to be marked with the
logfile
attribute. This made it impossible for a confined logrotate to rotate VM serial logs.Mark svirt_image_t as a logfile to ensure this works. While it feels a little odd to do this given that not every svirt_image_t file is a logfile, that's more of an issue with how overloaded the type already is. We have no choice but to treat it as the union of the things it can be.