提交 0230e383 编写于 作者: M Michal Privoznik

qemuProcessStop: Use XATTRs to restore seclabels on disks a domain is mirroring into

In v5.10.0-rc1~42 (which was later fixed in v6.0.0-rc1~487) I am
removing XATTRs for a file that QEMU is mirroring a disk into but
it is killed meanwhile. Well, we can call
qemuSecurityRestoreImageLabel() which will not only remove XATTRs
but also use them to restore the original owner of the file.

This would be done by blockjob code when the job finishes, but in
this case the job won't finish - QEMU is killed meanwhile
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 e2ecd9f4
......@@ -7597,8 +7597,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
for (i = 0; i < def->ndisks; i++) {
virDomainDiskDefPtr disk = def->disks[i];
if (disk->mirror)
qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->mirror);
if (disk->mirror) {
if (qemuSecurityRestoreImageLabel(driver, vm, disk->mirror, false) < 0)
VIR_WARN("Unable to restore security label on %s", disk->dst);
}
qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册