A not-a-bug reported that QEMU fails when cores=6,maxcpus=240, https://bugzilla.redhat.com/show_bug.cgi?id=1159264
The error message is qemu-kvm: max_cpus is too large. APIC ID of last CPU is 317 Misconfiguration, but how large can maxcpus be? There probably aren't many QEMU users with knowledge about initial APIC ID assignment, so it would be better to prevent confusion by making the error message more accessible. Especially since big VMs are spreading. Output after this patch is qemu-kvm: invalid CPU topology: maxcpus can't exceed 192 if cores=6 and threads=1 Looking for better wording ... (The main problem of this series is benefit/code ratio.) Radim Krčmář (3): target-i386: add apicid_pkg_width to topology.h target-i386: introduce x86_cpu_nr_apic_ids pc: improve error message with impossible max_cpus hw/i386/pc.c | 12 +++++++----- target-i386/cpu.c | 16 ++++++++++++++++ target-i386/cpu.h | 1 + target-i386/topology.h | 13 +++++++++++++ tests/test-x86-cpuid.c | 9 +++++++++ 5 files changed, 46 insertions(+), 5 deletions(-) -- 2.1.0