提交 9b2fbfa6 编写于 作者: P Peter Krempa

qemu: snapshot: Disallow snapshot of unsupported shared disks

Creating a snapshot would introduce a possibly unsupported member for
sharing into the backing chain. Add a check to prevent that from
happening.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480
上级 3b03a27c
......@@ -13944,6 +13944,24 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
}
static int
qemuDomainSnapshotPrepareDiskShared(virDomainSnapshotDiskDefPtr snapdisk,
virDomainDiskDefPtr domdisk)
{
if (!domdisk->src->shared || domdisk->src->readonly)
return 0;
if (!qemuBlockStorageSourceSupportsConcurrentAccess(snapdisk->src)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("shared access for disk '%s' requires use of "
"supported storage format"), domdisk->dst);
return -1;
}
return 0;
}
static int
qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdisk,
virDomainDiskDefPtr domdisk)
......@@ -14006,6 +14024,9 @@ qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdi
return -1;
}
if (qemuDomainSnapshotPrepareDiskShared(snapdisk, domdisk) < 0)
return -1;
return 0;
}
......@@ -14065,6 +14086,9 @@ qemuDomainSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDefPtr snapdisk
return -1;
}
if (qemuDomainSnapshotPrepareDiskShared(snapdisk, domdisk) < 0)
return -1;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册