render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
7548c0
From a8905f41cd62a0553e703f1b653dd4f6b1acd31f Mon Sep 17 00:00:00 2001
7548c0
Message-Id: <a8905f41cd62a0553e703f1b653dd4f6b1acd31f@dist-git>
7548c0
From: Michal Privoznik <mprivozn@redhat.com>
7548c0
Date: Wed, 7 Oct 2020 18:45:44 +0200
7548c0
Subject: [PATCH] qemuBuildNumaCommandLine: Fix @masterInitiator check
7548c0
MIME-Version: 1.0
7548c0
Content-Type: text/plain; charset=UTF-8
7548c0
Content-Transfer-Encoding: 8bit
7548c0
7548c0
A few commits ago, in aeecbc87b73, I've implemented command line
7548c0
generation for ACPI HMAT. For this, we need to know if at least
7548c0
one guest NUMA node has vCPUs. This is tracked in
7548c0
@masterInitiator variable, which is initialized to -1, then we
7548c0
iterate through guest NUMA nodes and break the loop if we find a
7548c0
node with a vCPU. After the loop, if masterInitiator is still
7548c0
negative then no NUMA node has a vCPU and we error out. But this
7548c0
exact check was missing comparison for negativeness.
7548c0
7548c0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7548c0
(cherry picked from commit ccf627c110a178afa529818474e555bca62fc165)
7548c0
7548c0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749518
7548c0
7548c0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7548c0
Message-Id: <d126e3fe0064d127a1ce6f36c36708e7501e4b5e.1602087923.git.mprivozn@redhat.com>
7548c0
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7548c0
---
7548c0
 src/qemu/qemu_command.c | 2 +-
7548c0
 1 file changed, 1 insertion(+), 1 deletion(-)
7548c0
7548c0
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
7548c0
index 959207bfea..67d7334b0f 100644
7548c0
--- a/src/qemu/qemu_command.c
7548c0
+++ b/src/qemu/qemu_command.c
7548c0
@@ -7542,7 +7542,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg,
7548c0
         }
7548c0
     }
7548c0
 
7548c0
-    if (masterInitiator) {
7548c0
+    if (masterInitiator < 0) {
7548c0
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
7548c0
                        _("At least one NUMA node has to have CPUs"));
7548c0
         goto cleanup;
7548c0
-- 
7548c0
2.29.2
7548c0