]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: don't check for backing chains for formats w/o snapshot support
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 16 Apr 2014 15:31:50 +0000 (17:31 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 24 Apr 2014 14:48:23 +0000 (16:48 +0200)
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>
src/qemu/qemu_domain.c

index bb9cb6b4ae379e91a4c989635b9a7f9e59efb243..ab197381096947b9157af3d40fd6df0bbf9614d8 100644 (file)
@@ -2268,8 +2268,18 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
     VIR_DEBUG("Checking for disk presence");
     for (i = vm->def->ndisks; i > 0; i--) {
         disk = vm->def->disks[i - 1];
+        const char *path = virDomainDiskGetSource(disk);
+        enum virStorageFileFormat format = virDomainDiskGetFormat(disk);
 
-        if (!virDomainDiskGetSource(disk))
+        if (!path)
+            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 (format >= VIR_STORAGE_FILE_NONE &&
+            format < VIR_STORAGE_FILE_BACKING &&
+            virFileExists(path))
             continue;
 
         if (qemuDomainDetermineDiskChain(driver, vm, disk, false) >= 0 &&