if (force_probe)
virStorageSourceBackingStoreClear(src);
+ /* There is no need to check the backing chain for disks without backing
+ * support */
+ if (virStorageSourceIsLocalStorage(src) &&
+ src->format > VIR_STORAGE_FILE_NONE &&
+ src->format < VIR_STORAGE_FILE_BACKING) {
+
+ if (!virFileExists(src->path)) {
+ if (report_broken)
+ virStorageFileReportBrokenChain(errno, src, disk->src);
+
+ goto cleanup;
+ }
+
+ ret = 0;
+ goto cleanup;
+ }
+
/* skip to the end of the chain if there is any */
while (virStorageSourceHasBacking(src)) {
if (report_broken &&
for (i = vm->def->ndisks; i > 0; i--) {
size_t idx = i - 1;
virDomainDiskDefPtr disk = vm->def->disks[idx];
- virStorageFileFormat format = virDomainDiskGetFormat(disk);
if (virStorageSourceIsEmpty(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 (virStorageSourceIsLocalStorage(disk->src) &&
- format > VIR_STORAGE_FILE_NONE &&
- format < VIR_STORAGE_FILE_BACKING &&
- virFileExists(virDomainDiskGetSource(disk)))
- continue;
-
if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) >= 0)
continue;