mirror of https://gitee.com/openkylin/libvirt.git
libxl: Break down an if() in libxlCapsInitNuma()
There's an if-else statement in libxlCapsInitNuma() that can really be just two standalone if()-s. Writing it as such helps with code readability. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
2c1f5cb105
commit
121083818e
|
@ -260,13 +260,13 @@ libxlCapsInitNuma(libxl_ctx *ctx, virCaps *caps)
|
|||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("libxl_get_numainfo failed"));
|
||||
goto cleanup;
|
||||
} else {
|
||||
cpu_topo = libxl_get_cpu_topology(ctx, &nr_cpus);
|
||||
if (cpu_topo == NULL || nr_cpus == 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("libxl_get_cpu_topology failed"));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
cpu_topo = libxl_get_cpu_topology(ctx, &nr_cpus);
|
||||
if (cpu_topo == NULL || nr_cpus == 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("libxl_get_cpu_topology failed"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cpus = g_new0(virCapsHostNUMACellCPU *, nr_nodes);
|
||||
|
|
Loading…
Reference in New Issue