This is a special CPU model similar to "-cpu host", so won't use our normal CPU model detection logic. Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 11 +++++++++++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d0378f94bc..ecfb313d0a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -614,6 +614,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 390 */ "vhost-user-blk", + "cpu-max", ); @@ -2984,12 +2985,22 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, virQEMUCapsAccelPtr accel, qemuMonitorPtr mon) { + qemuMonitorCPUDefsPtr defs = accel->cpuModels; + size_t i; + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) return 0; if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &accel->cpuModels) < 0) return -1; + for (i = 0; i < defs->ncpus; i++) { + if (STREQ_NULLABLE(defs->cpus[i].name, "max")) { + virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_MAX); + break; + } + } + return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 8cb5673042..79d443adfb 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -594,6 +594,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 390 */ QEMU_CAPS_DEVICE_VHOST_USER_BLK, /* -device vhost-user-blk */ + QEMU_CAPS_CPU_MAX, /* -cpu max */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; -- 2.29.2