[libvirt] [PATCH v2 1/7] virnuma: Introduce virNumaNodeIsAvailable

Daniel P. Berrange berrange at redhat.com
Thu Jun 19 10:52:30 UTC 2014


On Mon, Jun 16, 2014 at 05:08:24PM +0200, Michal Privoznik wrote:
> Not on all hosts the set of NUMA nodes IDs is continuous. This is
> critical, because our code currently assumes the set doesn't contain
> holes. For instance in nodeGetFreeMemory() we can see the following
> pattern:
> 
>     if ((max_node = virNumaGetMaxNode()) < 0)
>         return 0;
> 
>     for (n = 0; n <= max_node; n++) {
>         ...
>     }
> 
> while it should be something like this:
> 
>     if ((max_node = virNumaGetMaxNode()) < 0)
>         return 0;
> 
>     for (n = 0; n <= max_node; n++) {
>         if (!virNumaNodeIsAvailable(n))
>             continue;
>         ...
>     }
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/libvirt_private.syms |  1 +
>  src/util/virnuma.c       | 36 ++++++++++++++++++++++++++++++++++--
>  src/util/virnuma.h       |  1 +
>  3 files changed, 36 insertions(+), 2 deletions(-)

ACK


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list