On Fri, Nov 26, 2021 at 02:07:53PM +0100, Peter Krempa wrote:
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(a)redhat.com>
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_blockjob.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index faf9a9fb7d..6911a2a68d 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) {
--
2.31.1