This is a special CPU model similar to "-cpu host", so won't use our
normal CPU model detection logic.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
/* 390 */
"vhost-user-blk",
+ "cpu-max",
);
virQEMUCapsAccelPtr accel,
qemuMonitorPtr mon)
{
+ qemuMonitorCPUDefsPtr defs;
+ size_t i;
+
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS))
return 0;
if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &accel->cpuModels) < 0)
return -1;
+ defs = accel->cpuModels;
+ for (i = 0; i < defs->ncpus; i++) {
+ if (STREQ_NULLABLE(defs->cpus[i].name, "max")) {
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_MAX);
+ break;
+ }
+ }
+
return 0;
}
/* 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;