When -cpu host is supported by a QEMU binary, a user can use
<cpu mode='host-passthrough'/> in domain XML even when libvirtd failed
to find a matching model for the host CPU. Let's make it obvious by
advertising <cpuselection/> guest capability whenever -cpu host is
supported.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
machines = NULL;
nmachines = 0;
- if (caps->host.cpu &&
- caps->host.cpu->model &&
- virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0 &&
+ if ((virQEMUCapsGet(qemubinCaps, QEMU_CAPS_CPU_HOST) ||
+ (caps->host.cpu &&
+ caps->host.cpu->model &&
+ virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0)) &&
!virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='on' toggle='no'/>
<acpi default='on' toggle='yes'/>
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='off' toggle='no'/>
<acpi default='on' toggle='yes'/>