Cause:
When a guest is defined its XML is validated against some hard coded rules. Part of that was a check whether hint-dedicated feature is set if and only if guest cpu model is 'host-passthrough'. But as it turned out, this check is wrong, because all the hint-dedicated feature is available for all cpu models.
Consequence:
Libvirt denied defining or starting such guest.
Fix:
The fix consists of removing the problematic check.
Result:
Our validation is one bad check lighter and users can start their hint-dedicated guests happily.
Verify this bug with libvirt-daemon-7.0.0-14.6.module+el8.4.0+13801+378af433.x86_64:
1. prepare a guest which enable hint-dedicated and use host-model cpu mode
# virsh edit q35.xml
...
<features>
<acpi/>
<apic/>
<pae/>
<kvm>
<hint-dedicated state='on'/>
</kvm>
</features>
<cpu mode='host-model' check='partial'/>
Domain 'vm1' XML configuration edited
2. start guest
# virsh start vm1
Domain 'vm1' started
3. check qemu command line:
# ps aux|grep qemu
...kvm-hint-dedicated=on...
And test enable hint-dedicated with custom,host-passthrough cpu mode, got the same result
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Low: virt:av and virt-devel:av security and bug fix update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2022:0325
Verify this bug with libvirt-daemon-7.0.0-14.6.module+el8.4.0+13801+378af433.x86_64: 1. prepare a guest which enable hint-dedicated and use host-model cpu mode # virsh edit q35.xml ... <features> <acpi/> <apic/> <pae/> <kvm> <hint-dedicated state='on'/> </kvm> </features> <cpu mode='host-model' check='partial'/> Domain 'vm1' XML configuration edited 2. start guest # virsh start vm1 Domain 'vm1' started 3. check qemu command line: # ps aux|grep qemu ...kvm-hint-dedicated=on... And test enable hint-dedicated with custom,host-passthrough cpu mode, got the same result