提交 f0f1e79b 编写于 作者: M Michal Privoznik

qemuConnectOpen: Drop unused @cfg and simplify

After 65a372d6 the @cfg variable is no longer used. This means
we can drop it and therefore drop 'cleanup' label with it.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
上级 967f555d
......@@ -1094,44 +1094,37 @@ static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn,
virConfPtr conf ATTRIBUTE_UNUSED,
unsigned int flags)
{
virQEMUDriverConfigPtr cfg = NULL;
virDrvOpenStatus ret = VIR_DRV_OPEN_ERROR;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
if (qemu_driver == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("qemu state driver is not active"));
goto cleanup;
return VIR_DRV_OPEN_ERROR;
}
cfg = virQEMUDriverGetConfig(qemu_driver);
if (virQEMUDriverIsPrivileged(qemu_driver)) {
if (STRNEQ(conn->uri->path, "/system") &&
STRNEQ(conn->uri->path, "/session")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected QEMU URI path '%s', try qemu:///system"),
conn->uri->path);
goto cleanup;
return VIR_DRV_OPEN_ERROR;
}
} else {
if (STRNEQ(conn->uri->path, "/session")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected QEMU URI path '%s', try qemu:///session"),
conn->uri->path);
goto cleanup;
return VIR_DRV_OPEN_ERROR;
}
}
if (virConnectOpenEnsureACL(conn) < 0)
goto cleanup;
return VIR_DRV_OPEN_ERROR;
conn->privateData = qemu_driver;
ret = VIR_DRV_OPEN_SUCCESS;
cleanup:
virObjectUnref(cfg);
return ret;
return VIR_DRV_OPEN_SUCCESS;
}
static int qemuConnectClose(virConnectPtr conn)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册