Add option to skip cpu feature and model verification in libvirt and rely on qemu 'enforce' option
manish.mishra
manish.mishra at nutanix.com
Thu Nov 24 13:19:31 UTC 2022
On 24/11/22 5:40 pm, Jiri Denemark wrote:
> On Wed, Nov 23, 2022 at 18:34:38 +0530, manish.mishra wrote:
>> oh i see you meant something like this,
>>
>> <cpu mode='custom' match='exact' check='none'>
>> <numa>
>> <cell id='0' cpus='0-239' memory='8388608' unit='KiB' memAccess='shared'/>
>> </numa>
>> </cpu>
>>
>> <qemu:commandline>
>> <qemu:arg value='-cpu'/>
>> <qemu:arg value='enforce,Icelake-v4,x2apic=on,hv-time,kvm-pv-eoi=on'/>
>> </qemu:commandline>
> This won't work as libvirt should add a default CPU model there and
> replace check='none' with check='full' once the domain starts.
>
> But we actually have a way to do what you need even without any change
> in libvirt:
>
> <cpu mode='host-passthrough' check='none'>
> <topology .../>
> <numa>
> ...
> </numa>
> ...
> </cpu>
>
> <qemu:commandline>
> <qemu:arg value='-cpu'/>
> <qemu:arg value='Icelake-Server-v4,enforce,x2apic=on,hv-time,kvm-pv-eoi=on'/>
> </qemu:commandline>
>
> This will result in
>
> -cpu host,migratable=on
> ...
> -cpu Icelake-Server-v4,enforce,x2apic=on,hv-time,kvm-pv-eoi=on
>
> and libvirt will not touch the check='none' attribute once the domain
> starts and it would not complain about any unknown CPU features or
> models as there's nothing to check in <cpu/>.
>
> That is, there's no need to come up with anything special to support
> passing arbitrary options to -cpu.
>
> Jirka
Thank you so much Jirka, let me give this a try with few different cases. I will let you know how this goes or if we need anything extra.
Thanks
Manish Mishra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20221124/85aac8ea/attachment-0001.htm>
More information about the libvir-list
mailing list