提交 7d484ede 编写于 作者: P Pavel Mores 提交者: Peter Krempa

qemu: block: enable the snapshot image deletion feature

With all plumbing in place, we can now enable the new functionality.
Signed-off-by: NPavel Mores <pmores@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 73532dad
......@@ -18544,10 +18544,10 @@ qemuDomainBlockCommit(virDomainPtr dom,
bool persistjob = false;
bool blockdev = false;
/* XXX Add support for COMMIT_DELETE */
virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
VIR_DOMAIN_BLOCK_COMMIT_ACTIVE |
VIR_DOMAIN_BLOCK_COMMIT_RELATIVE |
VIR_DOMAIN_BLOCK_COMMIT_DELETE |
VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES, -1);
if (!(vm = qemuDomainObjFromDomain(dom)))
......@@ -18568,6 +18568,12 @@ qemuDomainBlockCommit(virDomainPtr dom,
blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("deleting committed images is not supported by this VM"));
goto endjob;
}
/* Convert bandwidth MiB to bytes, if necessary */
if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) {
if (speed > LLONG_MAX >> 20) {
......@@ -18686,7 +18692,8 @@ qemuDomainBlockCommit(virDomainPtr dom,
goto endjob;
if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
baseSource, false)))
baseSource,
flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)))
goto endjob;
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册