Blob Blame History Raw
From fa5cf4f38c5310ac24adf2011777c21827c3a727 Mon Sep 17 00:00:00 2001
Message-Id: <fa5cf4f38c5310ac24adf2011777c21827c3a727@dist-git>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 11 Jun 2019 10:55:05 +0200
Subject: [PATCH] qemu: Drop cleanup label from qemuProcessInitCpuAffinity()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We're using VIR_AUTOPTR() for everything now, plus the
cleanup section was not doing anything useful anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit de563ebcf9d72e5815933a0d715aa9c462bf50cc)

https://bugzilla.redhat.com/show_bug.cgi?id=1716908

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Message-Id: <20190611085506.12564-6-abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_process.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 0b2b7964e1..d0945b9c65 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2356,7 +2356,6 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
 static int
 qemuProcessInitCpuAffinity(virDomainObjPtr vm)
 {
-    int ret = -1;
     VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
     virDomainNumatuneMemMode mem_mode;
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -2387,25 +2386,24 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
                                              priv->autoNodeset,
                                              &nodeset,
                                              -1) < 0)
-            goto cleanup;
+            return -1;
 
         if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
-            goto cleanup;
+            return -1;
     } else if (vm->def->cputune.emulatorpin) {
         if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
-            goto cleanup;
+            return -1;
     } else {
         if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
-            goto cleanup;
+            return -1;
     }
 
     if (cpumapToSet &&
-        virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
-        goto cleanup;
+        virProcessSetAffinity(vm->pid, cpumapToSet) < 0) {
+        return -1;
+    }
 
-    ret = 0;
- cleanup:
-    return ret;
+    return 0;
 }
 
 /* set link states to down on interfaces at qemu start */
-- 
2.22.0