]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virnuma: Introduce virNumaNodeIsAvailable
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Jun 2014 12:29:15 +0000 (14:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 19 Jun 2014 13:10:49 +0000 (15:10 +0200)
commit356c6f389fcff5ca74b393a0d94f7542c1be9d81
treeda9bd262d3edcbb5ebb18bbdccd1b5d05fe8f6d5
parentf182da20b09d01b3eaba3c9ed81a7ffa215fc286
virnuma: Introduce virNumaNodeIsAvailable

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@redhat.com>
src/libvirt_private.syms
src/util/virnuma.c
src/util/virnuma.h