qemuBlockJobRewriteConfigDiskSource: Add debug statements when skipping disk update

It makes it easier to see what's going on when trying to figure out why
the disk definition was not updated on a finalized blockjob.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Peter Krempa 2021-11-26 13:30:49 +01:00
parent 70b0c2c183
commit c0b40323f8

View File

@ -667,14 +667,23 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObj *vm,
g_autoptr(virStorageSource) copy = NULL;
virStorageSource *n;
if (!vm->newDef)
if (!vm->newDef) {
VIR_DEBUG("not updating disk '%s' in persistent definition: no persistent definition",
disk->dst);
return;
}
if (!(persistDisk = virDomainDiskByTarget(vm->newDef, disk->dst)))
if (!(persistDisk = virDomainDiskByTarget(vm->newDef, disk->dst))) {
VIR_DEBUG("not updating disk '%s' in persistent definition: disk not present",
disk->dst);
return;
}
if (!virStorageSourceIsSameLocation(disk->src, persistDisk->src))
if (!virStorageSourceIsSameLocation(disk->src, persistDisk->src)) {
VIR_DEBUG("not updating disk '%s' in persistent definition: disk source doesn't match",
disk->dst);
return;
}
if (!(copy = virStorageSourceCopy(newsrc, true)) ||
virStorageSourceInitChainElement(copy, persistDisk->src, true) < 0) {