On 3/4/26 20:08, Roman Bogorodskiy wrote:
Bhyve supports NUMA domains configuration using the '-n' command line argument:
-n id,size,cpus[,domain_policy]
Here, "id" is a numeric NUMA domain id, "size" is the total VM memory size with units format similar to the "-m" switch, "cpus" is a cpuset, and "domain_policy" is an optional domainset(9) memory allocation policy. The "domain_policy" is currently not used by the libvirt driver.
This argument is repeated for every NUMA domain to be configured, e.g.:
bhyve \ ... -n id=0,size=107,cpus=0-3 -n id=1,size=107,cpus=4-7
To support that:
* Add a corresponding capability; it is considered supported if the bhyve binary has the '-n' command line switch.
* Generate command line arguments for NUMA from <cpu><numa>..</numa></cpu> domain configuration.
Additionally, validate that:
* NUMA domains can be only configured with the UEFI loaders. * No more than 8 domains configured per VM as limited by bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- src/bhyve/bhyve_capabilities.c | 3 ++ src/bhyve/bhyve_capabilities.h | 1 + src/bhyve/bhyve_command.c | 26 ++++++++++++ src/bhyve/bhyve_domain.c | 19 +++++++++ .../bhyvexml2argv-numa-empty-cpuset.xml | 29 +++++++++++++ .../bhyvexml2argv-numa-too-many-domains.xml | 36 ++++++++++++++++ .../x86_64/bhyvexml2argv-numa.args | 14 +++++++ .../x86_64/bhyvexml2argv-numa.ldargs | 1 + .../x86_64/bhyvexml2argv-numa.xml | 29 +++++++++++++ tests/bhyvexml2argvtest.c | 10 ++++- .../x86_64/bhyvexml2xmlout-numa.xml | 42 +++++++++++++++++++ tests/bhyvexml2xmltest.c | 1 + 12 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa-empty-cpuset.xml create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa-too-many-domains.xml create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.ldargs create mode 100644 tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.xml create mode 100644 tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-numa.xml
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal