Re: [PATCH 1/2] qemuBlockJobRewriteConfigDiskSource: Add debug statements when skipping disk update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

Reviewed-by: Martin Kletzander <mkletzan@xxxxxxxxxx>

---
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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux