util: Correct the NUMA node range checking
util: Correct the NUMA node range checking

There are 2 issues here: First we shouldn't add "1" to the return
value of numa_max_node(), since the semanteme of the error message
was changed, it's not saying about the number of total NUMA nodes
anymore.  Second, the value of "bit" is the position of the first
bit which exceeds either numa_max_node() or NUMA_NUM_NODES, it can
be any number in the range, so saying "bigger than $bit" is quite
confused now. For example, assuming there is a NUMA machine which
has 10 NUMA nodes, and one specifies the "nodeset" as "0,5,88",
the error message will be like:

Nodeset is out of range, host cannot support NUMA node bigger than 88

It sounds like all NUMA node number less than 88 is fine, but
actually the maximum NUMA node number the machine supports is 9.

This patch fixes the issues by removing the addition with "1" and
simplifies the error message as "NUMA node $bit is out of range".
Also simplifies the comparision in the while loop by getting the
smaller one of numa_max_node() and NUMA_NUM_NODES up front.

nertpinx/libvirt,olafhering/libvirt,rlaager/libvirt,fabianfreyer/libvirt,libvirt/libvirt,nertpinx/libvirt,elmarco/libvirt,fabianfreyer/libvirt,libvirt/libvirt,datto/libvirt,jardasgit/libvirt,jardasgit/libvirt,crobinso/libvirt,jfehlig/libvirt,libvirt/libvirt,elmarco/libvirt,eskultety/libvirt,nertpinx/libvirt,olafhering/libvirt,jardasgit/libvirt,datto/libvirt,taget/libvirt,eskultety/libvirt,crobinso/libvirt,olafhering/libvirt,elmarco/libvirt,jfehlig/libvirt,jfehlig/libvirt,nertpinx/libvirt,taget/libvirt,libvirt/libvirt,agx/libvirt,agx/libvirt,eskultety/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,taget/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,jfehlig/libvirt,shugaoye/libvirt,zippy2/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,shugaoye/libvirt,datto/libvirt,agx/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,elmarco/libvirt,VenkatDatta/libvirt,taget/libvirt,agx/libvirt,VenkatDatta/libvirt,rlaager/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,datto/libvirt,eskultety/libvirt,crobinso/libvirt,taget/libvirt,shugaoye/libvirt,andreabolognani/libvirt,eskultety/libvirt,andreabolognani/libvirt,zippy2/libvirt,nertpinx/libvirt,zippy2/libvirt,rlaager/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,rlaager/libvirt,jardasgit/libvirt,shugaoye/libvirt,datto/libvirt,elmarco/libvirt,agx/libvirt,rlaager/libvirt