mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: probe for "-cpu max" support
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>
This commit is contained in:
parent
7c1653f63a
commit
9c89cc5d6f
@ -614,6 +614,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||
|
||||
/* 390 */
|
||||
"vhost-user-blk",
|
||||
"cpu-max",
|
||||
);
|
||||
|
||||
|
||||
@ -2984,12 +2985,23 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user