On Thu, Apr 19, 2018 at 04:19:38PM +0200, Andrea Bolognani wrote:
vircapstest has code to add a full host NUMA topology, that
is, one that includes all information about nodes and CPUs
including IDs; testQemuCapsInit(), which is used to create a
mock virCapsPtr for QEMU tests, however, just fakes it by
setting nnumaCell_max to some number.
While the latter approach has served us well so far, we're
going to need all the information to be filled in soon. In
order to do that, we can just move the existing code from
vircapstest to testutils and, with some renaming and
trivial tweaking, use it as-is.
Interestingly, the NUMA topology generated by the function
is rigged up so that the NUMA nodes aren't (necessarily)
numbered starting from 0, which is a nice way to spot
mistaken assumptions in our codebase.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/testutils.c | 51 +++++++++++++++++++++++++++++++++++++++
tests/testutils.h | 2 ++
tests/testutilsqemu.c | 7 +++++-
tests/vircapstest.c | 66 ++++-----------------------------------------------
4 files changed, 64 insertions(+), 62 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano