]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: Break down an if() in libxlCapsInitNuma()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 12 May 2021 12:12:53 +0000 (14:12 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 May 2021 07:48:21 +0000 (09:48 +0200)
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>
src/libxl/libxl_capabilities.c

index a73f13f829ecc4d8f8da9c1df4dd201890271146..b8600ca479e095a786b4754d9a591d9cfb73f707 100644 (file)
@@ -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);