代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3e40b796a66a73fd2efd3a520f1f11a8a77fcea5 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <[email protected]>
Date: Fri, 21 Aug 2020 14:43:21 +0200
Subject: [PATCH 047/108] virnuma: Don't work around numa_node_to_cpus() for
non-existent nodes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In a very distant past, we came around machines that has not
continuous node IDs. This made us error out when constructing
capabilities XML. We resolved it by utilizing strange behaviour
of numa_node_to_cpus() in which it returned a mask with all bits
set for a non-existent node. However, this is not the only case
when it returns all ones mask - if the node exists and has enough
CPUs to fill the mask up (e.g. 128 CPUs).
The fix consists of using nodemask_isset(&numa_all_nodes, ..)
prior to calling numa_node_to_cpus() to determine if the node
exists.
Fixes: 628c93574758abb59e71160042524d321a33543f
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1860231
Signed-off-by: Michal Privoznik <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
(cherry picked from commit 24d7d85208f812a45686b32a0561cc9c5c9a49c9)
---
src/util/virnuma.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index eeca438f25..75d5628cff 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -256,31 +256,23 @@ virNumaGetNodeCPUs(int node,
int mask_n_bytes = max_n_cpus / 8;
size_t i;
g_autofree unsigned long *mask = NULL;
- g_autofree unsigned long *allonesmask = NULL;
g_autoptr(virBitmap) cpumap = NULL;
*cpus = NULL;
- if (VIR_ALLOC_N(mask, mask_n_bytes / sizeof(*mask)) < 0)
- return -1;
+ if (!nodemask_isset(&numa_all_nodes, node)) {
+ VIR_DEBUG("NUMA topology for cell %d is not available, ignoring", node);
+ return -2;
+ }
- if (VIR_ALLOC_N(allonesmask, mask_n_bytes / sizeof(*mask)) < 0)
+ if (VIR_ALLOC_N(mask, mask_n_bytes / sizeof(*mask)) < 0)
return -1;
- memset(allonesmask, 0xff, mask_n_bytes);
-
- /* The first time this returns -1, ENOENT if node doesn't exist... */
if (numa_node_to_cpus(node, mask, mask_n_bytes) < 0) {
VIR_WARN("NUMA topology for cell %d is not available, ignoring", node);
return -2;
}
- /* second, third... times it returns an all-1's mask */
- if (memcmp(mask, allonesmask, mask_n_bytes) == 0) {
- VIR_DEBUG("NUMA topology for cell %d is invalid, ignoring", node);
- return -2;
- }
-
if (!(cpumap = virBitmapNew(max_n_cpus)))
return -1;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。