When the Linux host CPU topology consistency check fails, virNodeGetInfo() returns a synthetic topology. For example, offlining one complete SMT core on each of two NUMA nodes can cause the legacy API to report one NUMA cell, one socket, and one thread per core. Applications cannot distinguish this fallback from detected topology using the existing virNodeInfo fields. We encountered this in a host management application that compared the node count from virNodeGetInfo() with the NUMA cells in capabilities XML. Capacity management had offlined host CPUs, and the synthetic node count no longer matched the detailed topology. This RFC proposes exposing whether the fallback was taken while preserving the legacy API behavior: 1. Add virNodeGetInfoWithFlags() and the VIR_NODE_INFO_TOPOLOGY_FALLBACK result bit, with QEMU driver and remote transport support, documentation, and host CPU test assertions. 2. Add virsh nodeinfo --topology-status, which appends "CPU topology: synthetic" or "CPU topology: detected". Without the option, virsh continues to use the original API and retains its existing output. The series leaves the public virNodeInfo layout and existing RPC reply unchanged. The new API uses a separate remote procedure. Unsupported drivers or older daemons return an error; lack of support is not interpreted as an absence of fallback. The indicator describes whether this particular fallback was taken. A clear bit is not a general guarantee that the legacy topology representation accurately describes every hardware arrangement. Applications needing detailed topology should continue to use virConnectGetCapabilities(). This series does not change the fallback calculation or fix topology and placement assumptions in consumers. Testing ------- Built libvirt 12.9.0 RPMs. All 65 cases in virhostcputest passed, including explicit assertions for normal and fallback topology fixtures. End-to-end testing used a 512-logical-CPU host with two NUMA nodes: NUMA node 0: CPUs 0-127,256-383 NUMA node 1: CPUs 128-255,384-511 Offlined one complete SMT core per node: NUMA node 0: SMT pair 127,383 NUMA node 1: SMT pair 255,511 With 508 CPUs online, the legacy command returned: CPU(s): 508 CPU socket(s): 1 Core(s) per socket: 512 Thread(s) per core: 1 NUMA cell(s): 1 The new virsh option appended: CPU topology: synthetic A standalone C client using virConnectOpenReadOnly("qemu:///system") and virNodeGetInfoWithFlags() returned resultFlags=0x1. After re-enabling all four CPUs, the legacy topology returned to: CPU(s): 512 CPU socket(s): 1 Core(s) per socket: 128 Thread(s) per core: 2 NUMA cell(s): 2 The new option reported "CPU topology: detected", and the C client returned resultFlags=0x0. Both states were checked with explicit qemu:///system and default virsh connections, with and without -r. Legacy nodeinfo output was retained in each state. These are targeted host CPU and integration results; they do not establish a full test-suite pass. RFC questions ------------- Is exposing the fallback state useful enough to justify a new public API, given the recommendation to use capabilities XML for detailed topology? Feedback on the API shape, result flag naming, and virsh presentation would be appreciated. The patches are based on libvirt v12.9.0 (7e809448198e). API version annotations and the new RPC procedure number reflect that base and would need adjustment to the target development branch before merge. Partha Sarathi Satapathy (2): node: Introduce virNodeGetInfoWithFlags virsh: Add --topology-status to nodeinfo docs/manpages/virsh.rst | 12 +++++++- include/libvirt/libvirt-host.h | 16 ++++++++++ src/conf/capabilities.c | 18 ++++++++++- src/conf/capabilities.h | 2 ++ src/driver-hypervisor.h | 7 +++++ src/libvirt-host.c | 57 +++++++++++++++++++++++++++++++++++ src/libvirt_private.syms | 1 + src/libvirt_public.syms | 5 ++++ src/qemu/qemu_driver.c | 16 ++++++++++ src/remote/remote_daemon_dispatch.c | 37 +++++++++++++++++++++++ src/remote/remote_driver.c | 34 +++++++++++++++++++++ src/remote/remote_protocol.x | 18 ++++++++++- src/remote_protocol-structs | 8 +++++ src/util/virhostcpu.c | 16 ++++++++-- src/util/virhostcpu.h | 3 +- src/util/virhostcpupriv.h | 3 +- tests/virhostcputest.c | 60 ++++++++++++++++++++++--------------- tools/virsh-host.c | 25 ++++++++++++++-- 18 files changed, 303 insertions(+), 35 deletions(-) -- 2.43.7