Skip to content

Conversation

cjriches
Copy link

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.

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.

Signed-off-by: Chris Riches <[email protected]>
@cjriches
Copy link
Author

I'd be particularly interested in reviewers' opinions on whether it's sensible for libvirt to create serial logs with this context in the first place, or if we should instead prevent it from doing that and leave the policy unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant