0a7476
From dea07e831c50f648e7eaf5706713ecbdf9de813a Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <dea07e831c50f648e7eaf5706713ecbdf9de813a@dist-git>
0a7476
From: Andrea Bolognani <abologna@redhat.com>
0a7476
Date: Fri, 7 Jun 2019 11:59:08 +0200
0a7476
Subject: [PATCH] qemu: Drop cleanup label from qemuProcessInitCpuAffinity()
0a7476
MIME-Version: 1.0
0a7476
Content-Type: text/plain; charset=UTF-8
0a7476
Content-Transfer-Encoding: 8bit
0a7476
0a7476
We're using VIR_AUTOPTR() for everything now, plus the
0a7476
cleanup section was not doing anything useful anyway.
0a7476
0a7476
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
0a7476
Reviewed-by: Ján Tomko <jtomko@redhat.com>
0a7476
(cherry picked from commit de563ebcf9d72e5815933a0d715aa9c462bf50cc)
0a7476
0a7476
https://bugzilla.redhat.com/show_bug.cgi?id=1718172
0a7476
0a7476
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
0a7476
Message-Id: <20190607095909.5538-2-abologna@redhat.com>
0a7476
Reviewed-by: Ján Tomko <jtomko@redhat.com>
0a7476
---
0a7476
 src/qemu/qemu_process.c | 18 ++++++++----------
0a7476
 1 file changed, 8 insertions(+), 10 deletions(-)
0a7476
0a7476
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
0a7476
index f77c2ad275..f68a345c54 100644
0a7476
--- a/src/qemu/qemu_process.c
0a7476
+++ b/src/qemu/qemu_process.c
0a7476
@@ -2356,7 +2356,6 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
0a7476
 static int
0a7476
 qemuProcessInitCpuAffinity(virDomainObjPtr vm)
0a7476
 {
0a7476
-    int ret = -1;
0a7476
     VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
0a7476
     virDomainNumatuneMemMode mem_mode;
0a7476
     qemuDomainObjPrivatePtr priv = vm->privateData;
0a7476
@@ -2387,25 +2386,24 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
0a7476
                                              priv->autoNodeset,
0a7476
                                              &nodeset,
0a7476
                                              -1) < 0)
0a7476
-            goto cleanup;
0a7476
+            return -1;
0a7476
 
0a7476
         if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
0a7476
-            goto cleanup;
0a7476
+            return -1;
0a7476
     } else if (vm->def->cputune.emulatorpin) {
0a7476
         if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
0a7476
-            goto cleanup;
0a7476
+            return -1;
0a7476
     } else {
0a7476
         if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
0a7476
-            goto cleanup;
0a7476
+            return -1;
0a7476
     }
0a7476
 
0a7476
     if (cpumapToSet &&
0a7476
-        virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
0a7476
-        goto cleanup;
0a7476
+        virProcessSetAffinity(vm->pid, cpumapToSet) < 0) {
0a7476
+        return -1;
0a7476
+    }
0a7476
 
0a7476
-    ret = 0;
0a7476
- cleanup:
0a7476
-    return ret;
0a7476
+    return 0;
0a7476
 }
0a7476
 
0a7476
 /* set link states to down on interfaces at qemu start */
0a7476
-- 
0a7476
2.21.0
0a7476