virnuma: Don't work around numa_node_to_cpus() for non-existent nodes
virnuma: Don't work around numa_node_to_cpus() for non-existent nodes

In a very distant past, we came around machines that has not
continuous node IDs. This made us error out when constructing
capabilities XML. We resolved it by utilizing strange behaviour
of numa_node_to_cpus() in which it returned a mask with all bits
set for a non-existent node. However, this is not the only case
when it returns all ones mask - if the node exists and has enough
CPUs to fill the mask up (e.g. 128 CPUs).

The fix consists of using nodemask_isset(&numa_all_nodes, ..)
prior to calling numa_node_to_cpus() to determine if the node
exists.

Fixes: 628c93574758abb59e71160042524d321a33543f
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1860231
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

libvirt/libvirt,jardasgit/libvirt,olafhering/libvirt,nertpinx/libvirt,nertpinx/libvirt,jardasgit/libvirt,nertpinx/libvirt,jardasgit/libvirt,zippy2/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,zippy2/libvirt,jfehlig/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,jardasgit/libvirt,zippy2/libvirt,olafhering/libvirt,libvirt/libvirt,nertpinx/libvirt,crobinso/libvirt,crobinso/libvirt,jardasgit/libvirt,jfehlig/libvirt,libvirt/libvirt,crobinso/libvirt,jfehlig/libvirt,crobinso/libvirt