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