mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuSnapshotPrepareDiskExternal: Refactor existing file check
Use the snapshot disk type from the definition now that we validate that it matches. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
919b129603
commit
308aafe289
@ -607,10 +607,11 @@ qemuSnapshotPrepareDiskExternal(virDomainObj *vm,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!S_ISBLK(st.st_mode) && st.st_size && !reuse) {
|
||||
if (!reuse &&
|
||||
snapdisk->src->type == VIR_STORAGE_TYPE_FILE &&
|
||||
st.st_size > 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("external snapshot file for disk %s already "
|
||||
"exists and is not a block device: %s"),
|
||||
_("external snapshot file for disk %s already exists and is not a block device: %s"),
|
||||
snapdisk->name, snapdisk->src->path);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user