File libvirt-qemu-don-t-check-for-backing-chains-for-formats-w-o-snapshot-support.patch of Package libvirt
From 1fbd4798eaf80b3ca9b97b1f911f8bd2877fb185 Mon Sep 17 00:00:00 2001
Message-Id: <1fbd4798eaf80b3ca9b97b1f911f8bd2877fb185@dist-git>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 29 Apr 2014 11:40:18 +0200
Subject: [PATCH] qemu: don't check for backing chains for formats w/o snapshot
support
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1019926
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=868673
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 955668138873f2dd9b2e9989fecaddb33dc149c7)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Conflicts:
src/qemu/qemu_domain.c -- virStorageFile accessors
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_domain.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c34f149..35e0a4a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1958,6 +1958,14 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
if (!disk->src)
continue;
+ /* There is no need to check the backing chain for disks
+ * without backing support, the fact that the file exists is
+ * more than enough */
+ if (disk->format >= VIR_STORAGE_FILE_NONE &&
+ disk->format < VIR_STORAGE_FILE_BACKING &&
+ virFileExists(disk->src))
+ continue;
+
if (qemuDomainDetermineDiskChain(driver, disk, false) >= 0 &&
qemuDiskChainCheckBroken(disk) >= 0)
continue;
@@ -2097,4 +2105,3 @@ qemuDomainDetermineDiskChain(struct qemud_driver *driver,
return -1;
return 0;
}
-
--
1.9.2