提交 067aad26 编写于 作者: N Nikolay Shirokovskiy

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: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 fa30ee04
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册