[libvirt] [PATCH v2 08/10] nodeinfo: Use nodeGetOnlineCPUBitmap() when parsing node

Peter Krempa pkrempa at redhat.com
Wed Jul 22 08:34:49 UTC 2015


On Mon, Jul 20, 2015 at 18:37:28 +0200, Andrea Bolognani wrote:
> No need to look up the online status of each CPU separately when we
> can get all the information in one go.
> ---
>  src/nodeinfo.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index 7d0e6b0..c97dece 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -409,6 +409,7 @@ virNodeParseNode(const char *sysfs_prefix,
>      DIR *cpudir = NULL;
>      struct dirent *cpudirent = NULL;
>      virBitmapPtr present_cpumap = NULL;
> +    virBitmapPtr online_cpus_map = NULL;
>      virBitmapPtr sockets_map = NULL;
>      virBitmapPtr *cores_maps = NULL;
>      int sock_max = 0;
> @@ -417,7 +418,6 @@ virNodeParseNode(const char *sysfs_prefix,
>      size_t i;
>      int siblings;
>      unsigned int cpu;
> -    int online;
>      int direrr;
>  
>      *threads = 0;
> @@ -432,6 +432,9 @@ virNodeParseNode(const char *sysfs_prefix,
>      present_cpumap = nodeGetPresentCPUBitmap(sysfs_prefix);
>      if (!present_cpumap)
>          goto cleanup;
> +    online_cpus_map = nodeGetOnlineCPUBitmap(sysfs_prefix, NULL);

This can't be compiled since nodeGetOnlineCPUBitmap doesn't have the
second parameter. I see that you've fixed it in next commit so I'll move
it here before pushing.

> +    if (!online_cpus_map)
> +        goto cleanup;
>  
>      /* enumerate sockets in the node */
>      if (!(sockets_map = virBitmapNew(ID_MAX + 1)))

ACK otherwise
-------------- 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/20150722/5d72b7a9/attachment-0001.sig>


More information about the libvir-list mailing list