[libvirt] [PATCH] nodeinfo: Check for errors when reading core_id

Peter Krempa pkrempa at redhat.com
Thu Jul 23 09:58:46 UTC 2015


On Thu, Jul 23, 2015 at 11:47:05 +0200, Andrea Bolognani wrote:

This was introduced in my commit
80533ca25d809a2a3e81266a0acabf61a0f86ced but actually made prominent by
the last refactor of yours.

> ---
>  src/nodeinfo.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index fb932c8..ba633a1 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -512,7 +512,9 @@ virNodeParseNode(const char *node,
>              /* logical cpu is equivalent to a core on s390 */
>              core = cpu;
>          } else {
> -            core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
> +            if ((core = virNodeGetCpuValue(node, cpu,
> +                                           "topology/core_id", 0)) < 0)
> +                goto cleanup;
>          }
>          if (core > ID_MAX) {
>              virReportError(VIR_ERR_INTERNAL_ERROR,

ACK I'll push this patch in a while.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150723/e8cbd0f8/attachment-0001.sig>


More information about the libvir-list mailing list