qemuConnectOpen: Drop unused @cfg and simplify

After 65a372d6e0 the @cfg variable is no longer used. This means
we can drop it and therefore drop 'cleanup' label with it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Michal Privoznik 2019-04-30 11:44:22 +02:00
parent 967f555da7
commit f0f1e79bf5

View File

@ -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)