1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-10 17:57:25 +03:00

qemu: snapshot: Restrict file existence check only for local storage

Soon we'll allow more protocols and storage types with snapshots where
we in some cases can't check whether the storage already exists.
Restrict the sanity checks whether the destination images exist or not
for local storage where it's easy. For any other case we will fail
later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-08-12 13:48:51 +02:00
parent 7921e9b088
commit 9d80fdcd63

View File

@ -15008,6 +15008,7 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainDiskDefPtr disk,
return -1;
}
if (virStorageSourceIsLocalStorage(snapdisk->src)) {
if (virStorageFileInit(snapdisk->src) < 0)
return -1;
@ -15035,6 +15036,7 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainDiskDefPtr disk,
snapdisk->name, snapdisk->src->path);
return -1;
}
}
return 0;
}