This patch reworks libvmmapi to provide support for emulating NUMA domains in guests.
More specifically, it reworks vm_setup_memory to setup system memory segments for each guest NUMA domain, adds per-domain CPU affinity tracking to struct vm_ctx, and adds two new routines for fetching and setting a domain's CPU set.
An emulated NUMA domain is described by a struct vmdom in vmmapi.h. Aside from its size in bytes, each domain can be configured to use a specific domainset(9) policy and domain mask.
vm_setup_memory now takes two additional arguments - an array of struct vmdoms and the array's size. It then proceeds to set up a memory segment for each specified domain using the existing memory mapping scheme. If no domain info is passed, the memory setup falls back to the original, non-NUMA behaviour.