Description of problem: We (oVirt's VDSM) need to know vCPU to NUMA node mapping for reporting purposes. We are getting the information by querying for ./vcpus/vcpu/pid nodes in the domain XML which is slow (and requires parsing of the whole domain every time). We would appreciate if there was an API call to give us NUMA information directly.
I'm unclear why the performance of parsing XML is a problem in this case. The mapping of VCPUs <-> NUMA nodes never changes once a guest has been booted. In addition VDSM is in full control of the guest configuration. So VDSM should already know what mapping it configured, and if it doesn't it merely needs to parse the XML once after boot to figure it out, which is not going to be a performance hit. So based on your description, I don't really see any compelling reason to add an API for getting this info.
Closing as WONTFIX per Dan's comment #1
Uh guys.. the mapping might change, ever heard about auto-numa? It might not be the best thing the kernel does, but it is here and might rebalance the nodes without us knowing about it.
redirecting the needinfo
Moving needinfo to danpb since he wrote Comment 1, but maybe pkrempa has thoughts since he's done VCPU API work in libvirt recently
We should already be reporting the vCPU <-> pCPU mapping via the virDomainGetVcpuPinInfo() API, and you can map pCPUs to NUMA cells using the capabilities XML, so I'm still not seeing a need for new APIs.
We decided to remove the numa status runtime reporting so we do not need this anymore.