]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_tpm: Set log file label on migration
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 2 Dec 2022 15:09:37 +0000 (16:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 5 Dec 2022 09:40:52 +0000 (10:40 +0100)
commit713578d77fec3a85eebe9aeaeec1c6be72e93e6a
tree69078ec601056627af621a66c51fa53c7295bb78
parent3c2e55c5ed375c6c1132cc5a224d29a2eadfb7ea
qemu_tpm: Set log file label on migration

Recently, the QEMU driver gained support for migration with TPM
state on a shared volume (e.g. NFS). As a part of that, the
destination side avoids setting seclabels on it to avoid cutting
off the source while it is still using it. Makes sense, except
for a wee bit: the secdriver API does a bit more - it also sets
label on the swtpm log file. And this one definitely needs to be
labeled (it lives under /var/log/swtpm/libvirt/qemu/..., i.e. not
on a shared volume).

Previously, qemuSecurityStartTPMEmulator() took care of that. But
during rework to shared volume migration, the code was changed so
now plain qemuSecurityCommandRun() would be run (i.e. no
relabelling).

But after previous commits, we can now chose whether the TPM
state should be relabelled or just the log file.

Fixes: 2e669ec789231d39e0d5f5f6a201d2a661b8070c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2130192#c7
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_tpm.c