提交 ba7c026d 编写于 作者: J Ján Tomko

Do not return number of set bits in virBitmapParse

This is only used by one caller.
上级 dc5821d7
...@@ -419,7 +419,7 @@ char *virBitmapFormat(virBitmapPtr bitmap) ...@@ -419,7 +419,7 @@ char *virBitmapFormat(virBitmapPtr bitmap)
* Pass 0 as @terminator if it is not needed. Whitespace characters may not * Pass 0 as @terminator if it is not needed. Whitespace characters may not
* be used as terminators. * be used as terminators.
* *
* Returns the number of bits set in @bitmap, or -1 in case of error. * Returns 0 on success, or -1 in case of error.
*/ */
int int
virBitmapParse(const char *str, virBitmapParse(const char *str,
...@@ -509,7 +509,7 @@ virBitmapParse(const char *str, ...@@ -509,7 +509,7 @@ virBitmapParse(const char *str,
} }
} }
return virBitmapCountBits(*bitmap); return 0;
error: error:
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,
......
...@@ -1049,9 +1049,10 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps) ...@@ -1049,9 +1049,10 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps)
if (!(cpuset = virBitmapNew(numCpus))) if (!(cpuset = virBitmapNew(numCpus)))
goto error; goto error;
} else { } else {
nb_cpus = virBitmapParse(cur, 'n', &cpuset, numCpus); if (virBitmapParse(cur, 'n', &cpuset, numCpus) < 0)
if (nb_cpus < 0)
goto error; goto error;
nb_cpus = virBitmapCountBits(cpuset);
} }
if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) { if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册