From: Martin Kletzander Date: Wed, 16 Apr 2014 15:31:50 +0000 (+0200) Subject: qemu: don't check for backing chains for formats w/o snapshot support X-Git-Tag: v1.2.4-rc1~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=955668138873f2dd9b2e9989fecaddb33dc149c7;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index bb9cb6b4ae..ab19738109 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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 &&