render / rpms / libvirt

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