render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From a8905f41cd62a0553e703f1b653dd4f6b1acd31f Mon Sep 17 00:00:00 2001
Message-Id: <a8905f41cd62a0553e703f1b653dd4f6b1acd31f@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 7 Oct 2020 18:45:44 +0200
Subject: [PATCH] qemuBuildNumaCommandLine: Fix @masterInitiator check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

A few commits ago, in aeecbc87b73, I've implemented command line
generation for ACPI HMAT. For this, we need to know if at least
one guest NUMA node has vCPUs. This is tracked in
@masterInitiator variable, which is initialized to -1, then we
iterate through guest NUMA nodes and break the loop if we find a
node with a vCPU. After the loop, if masterInitiator is still
negative then no NUMA node has a vCPU and we error out. But this
exact check was missing comparison for negativeness.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit ccf627c110a178afa529818474e555bca62fc165)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749518

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <d126e3fe0064d127a1ce6f36c36708e7501e4b5e.1602087923.git.mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 959207bfea..67d7334b0f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7542,7 +7542,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg,
         }
     }
 
-    if (masterInitiator) {
+    if (masterInitiator < 0) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("At least one NUMA node has to have CPUs"));
         goto cleanup;
-- 
2.29.2