提交 421c9550 编写于 作者: P Peter Krempa

qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull

Add a 'cleanup' label and use jumps as we do in other places.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 e5cf665b
......@@ -18512,24 +18512,27 @@ qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth,
unsigned int flags)
{
virDomainObjPtr vm;
int ret = -1;
virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1);
if (!(vm = qemuDomainObjFromDomain(dom)))
return -1;
if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) {
virDomainObjEndAPI(&vm);
return -1;
}
if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (virDomainListCheckpoints(vm->checkpoints, NULL, dom, NULL, 0) > 0) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot perform block pull while checkpoint exists"));
virDomainObjEndAPI(&vm);
return -1;
goto cleanup;
}
return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags);
ret = qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags);
cleanup:
virDomainObjEndAPI(&vm);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册