render / rpms / libvirt

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