]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainNumaFillCPUsInNode: Skip over NUMA nodes without vCPUs
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 30 Sep 2020 08:37:29 +0000 (10:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 1 Oct 2020 08:36:17 +0000 (10:36 +0200)
commit2752a67826a89b9b1a1367c67210b5720bae0fe1
tree5cd5867b40d45996f988cf8545835a08e23bc8a4
parentce54d182ba855b435b63e47d054cf5393503f643
virDomainNumaFillCPUsInNode: Skip over NUMA nodes without vCPUs

After v6.5.0-rc1~148 we started to rectify vCPU to guest NUMA
assignment - if there is a vCPU not assigned to any guest NUMA
node it is automatically assigned to node #0.

A month later I've made it possible to define guest NUMA nodes
without vCPUs (v6.6.0-rc1~250) - this is needed because of HMAT.
As a part of that I fixed all callers of
virDomainNumaGetNodeCpumask() (which returns a bitmap of vCPUs for
given node) to handle case when NULL is returned (i.e. no vCPUs
assigned to given node). But of course my patch was written
before aforementioned vCPU rectify patch but merged afterwards
and hence I missed the virDomainNumaFillCPUsInNode() caller.

And because we are dealing with a NULL pointer, of course this
leads to a crash. Just try to define a domain with at least two
NUMA nodes and no vCPU assignment to any of the nodes.

Fixes: a26f61ee0cffa421b87ef568002b684dd8025432
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1880289
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/conf/numa_conf.c