render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
e8e641
From dc65b0e0895a556252f523b799a7144566ca388f Mon Sep 17 00:00:00 2001
e8e641
Message-Id: <dc65b0e0895a556252f523b799a7144566ca388f@dist-git>
e8e641
From: Michal Privoznik <mprivozn@redhat.com>
e8e641
Date: Tue, 7 Mar 2023 12:31:08 +0100
e8e641
Subject: [PATCH] qemu: Fix qemuDomainGetEmulatorPinInfo()
e8e641
e8e641
The order of pinning priority (at least for emulator thread) was
e8e641
set by v1.2.15-rc1~58 (for cgroup code). But later, when
e8e641
automatic placement was implemented into
e8e641
qemuDomainGetEmulatorPinInfo(), the priority was not honored.
e8e641
e8e641
Now that we have this priority code in a separate function, we
e8e641
can just call that and avoid this type of error.
e8e641
e8e641
Fixes: 776924e37649f2d47acd805746d5fd9325212ea5
e8e641
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
e8e641
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
e8e641
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
e8e641
(cherry picked from commit 7feed1613df72acd6dbcb65513942163b56e6b3a)
e8e641
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2185039
e8e641
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
e8e641
---
e8e641
 src/qemu/qemu_driver.c | 11 +++--------
e8e641
 1 file changed, 3 insertions(+), 8 deletions(-)
e8e641
e8e641
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
e8e641
index d00b91fe0b..fffb0a9ac5 100644
e8e641
--- a/src/qemu/qemu_driver.c
e8e641
+++ b/src/qemu/qemu_driver.c
e8e641
@@ -4574,14 +4574,9 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
e8e641
     if (live)
e8e641
         autoCpuset = QEMU_DOMAIN_PRIVATE(vm)->autoCpuset;
e8e641
 
e8e641
-    if (def->cputune.emulatorpin) {
e8e641
-        cpumask = def->cputune.emulatorpin;
e8e641
-    } else if (def->cpumask) {
e8e641
-        cpumask = def->cpumask;
e8e641
-    } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
e8e641
-               autoCpuset) {
e8e641
-        cpumask = autoCpuset;
e8e641
-    } else {
e8e641
+    if (!(cpumask = qemuDomainEvaluateCPUMask(def,
e8e641
+                                              def->cputune.emulatorpin,
e8e641
+                                              autoCpuset))) {
e8e641
         if (!(bitmap = virHostCPUGetAvailableCPUsBitmap()))
e8e641
             goto cleanup;
e8e641
         cpumask = bitmap;
e8e641
-- 
e8e641
2.40.0