mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: disable external snapshot of readonly disk
Disable external snapshot of a readonly disk for domains as
this operation is not very useful. Such a snapshot is not
possible for active domains but the error message from QEMU
is more cryptic:
error: internal error: unable to execute QEMU command 'transaction':
Could not create file: Permission denied
This error at least makes the error more understandable for
active domains and disallows for inactive domains as well.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@@ -14755,6 +14755,13 @@ qemuDomainSnapshotPrepareDiskExternal(virDomainDiskDefPtr disk,
|
||||
int ret = -1;
|
||||
struct stat st;
|
||||
|
||||
if (disk->src->readonly) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("external snapshot for readonly disk %s "
|
||||
"is not supported"), disk->dst);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuTranslateSnapshotDiskSourcePool(snapdisk) < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user