There is only one caller of virDomainNumaSetNodeCpumask() which
checks for the return value but because the function will return
NULL iff the @cpumask was NULL in the first place. But in that
place @cpumask can't be NULL because it was just allocated by
virBitmapParse().
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/numa_conf.c | 4 +---
src/conf/numa_conf.h | 6 +++---
src/libxl/xen_xl.c | 4 ++--
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 2685a3e828..7b9084456e 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -1317,14 +1317,12 @@ virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
}
-virBitmapPtr
+void
virDomainNumaSetNodeCpumask(virDomainNumaPtr numa,
size_t node,
virBitmapPtr cpumask)
{
numa->mem_nodes[node].cpumask = cpumask;
-
- return numa->mem_nodes[node].cpumask;
}
diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
index 206dffe304..25e896826b 100644
--- a/src/conf/numa_conf.h
+++ b/src/conf/numa_conf.h
@@ -155,9 +155,9 @@ size_t virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa,
size_t ndistances)
ATTRIBUTE_NONNULL(1);
-virBitmapPtr virDomainNumaSetNodeCpumask(virDomainNumaPtr numa,
- size_t node,
- virBitmapPtr cpumask)
+void virDomainNumaSetNodeCpumask(virDomainNumaPtr numa,
+ size_t node,
+ virBitmapPtr cpumask)
ATTRIBUTE_NONNULL(1);
/*
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index d40c2e1d8e..1c1279e1cb 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -508,10 +508,10 @@ xenParseXLVnuma(virConfPtr conf,
goto cleanup;
}
- if ((virBitmapParse(vtoken, &cpumask, VIR_DOMAIN_CPUMASK_LEN)
< 0) ||
- (virDomainNumaSetNodeCpumask(numa, vnodeCnt, cpumask) ==
NULL))
+ if (virBitmapParse(vtoken, &cpumask, VIR_DOMAIN_CPUMASK_LEN)
< 0)
goto cleanup;
+ virDomainNumaSetNodeCpumask(numa, vnodeCnt, cpumask);
vcpus += virBitmapCountBits(cpumask);
} else if (STRPREFIX(str, "vdistances")) {
--
2.26.2