mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
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: Michal Privoznik <mprivozn@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
20cc7f9e8a
commit
70d353356d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user