From: Peter Krempa Date: Fri, 26 Nov 2021 12:30:49 +0000 (+0100) Subject: qemuBlockJobRewriteConfigDiskSource: Add debug statements when skipping disk update X-Git-Tag: v8.0.0-rc1~432 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0b40323f8697353bf918a142bb50ca3c4e398ac;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Martin Kletzander --- diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index e57902df8c..56cb83d999 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -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) {