提交 d4b5bb5d 编写于 作者: P Peter Krempa

qemuDomainBlockCommit: Move checks depending on capabilities after liveness check

Since capabilities are not present for inactive VMs we'd report that we
don't support '--delete' or committing while checkpoints exist rather
than the proper error.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 0ce8b0fb
......@@ -18413,9 +18413,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (virDomainBlockCommitEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
goto cleanup;
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
......@@ -18424,12 +18421,6 @@ 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) {
......@@ -18454,6 +18445,15 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (qemuDomainDiskBlockJobIsActive(disk))
goto endjob;
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
goto endjob;
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;
}
if (!top || STREQ(top, disk->dst))
topSource = disk->src;
else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) < 0 ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册