提交 70d35335 编写于 作者: M Michal Privoznik

qemu_blockjob: Remove secdriver metadata for whole backing chain on job completion

Turns out, block mirror is not the only job a disk can have. It
can also do commits of one layer into the other. Or possibly some
other tricks too. Problem is that while we set seclabels on given
layers of backing chain when the job is starting (via
qemuDomainStorageSourceAccessAllow()) we don't restore them when
job finishes. This leaves XATTRs set and corresponding images
unusable.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
ACKed-by: NPeter Krempa <pkrempa@redhat.com>
上级 20cc7f9e
......@@ -664,9 +664,9 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
virObjectUnref(disk->src);
disk->src = disk->mirror;
} else {
if (disk->mirror) {
virStorageSourcePtr n;
virStorageSourcePtr n;
if (disk->mirror) {
virDomainLockImageDetach(driver->lockManager, vm, disk->mirror);
/* Ideally, we would restore seclabels on the backing chain here
......@@ -684,6 +684,16 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
virObjectUnref(disk->mirror);
}
for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
if (qemuSecurityMoveImageMetadata(driver, vm, n, NULL) < 0) {
VIR_WARN("Unable to remove disk metadata on "
"vm %s from %s (disk target %s)",
vm->def->name,
NULLSTR(n->path),
disk->dst);
}
}
}
/* Recompute the cached backing chain to match our
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册