I just did a quick audit of getCapabilities() in Nova upstream (`git describe`: 28.0.0-26-g6094a682917), and here is it.
If we embark on replacing getCapabilities() usage with getDomainCapabilities() API where appropriate, then we have to carefully comb through each of this usage and explore what can be replaced. All without introducing any regressions or other subtle bugs.
!Important! We have to be careful to only touch the usage where host CPU definition from getCapabilities() is being used rather then eliminating the use of getCapabilities() altogether!
* * *
Usage of getCapabilities
------------------------
The following is the usage of getCapabilities(), either directly or via
the wrapper method, get_capabilities() in libvirt/host.py:
- get_domain_capabilities()
- get_canonical_machine_type()
- has_hyperthreading()
- supports_uefi()
- supports_secure_boot()
- supports_amd_sev()
- get_cpu_model_names()
"Get the cpu models based on host CPU arch -- :returns: a list of
cpu models which supported by the given CPU arch"
And the usage of host.get_capabilities() in libvirt/driver.py:
- _do_quality_warnings()
- _get_guest_cpu_model_config()
- _match_cpu_model_by_flags()
- _get_guest_cpu_config()
- _get_host_sysinfo_serial_hardware()
- _check_uefi_support()
- _configure_guest_by_virt_type()
- _guest_needs_pcie()
* * *
Perhaps we can start with evaluating these methods and see what can be replaced there:
I just did a quick audit of getCapabilities() in Nova upstream (`git describe`: 28.0.0- 26-g6094a682917 ), and here is it.
If we embark on replacing getCapabilities() usage with getDomainCapabi lities( ) API where appropriate, then we have to carefully comb through each of this usage and explore what can be replaced. All without introducing any regressions or other subtle bugs.
!Important! We have to be careful to only touch the usage where host CPU definition from getCapabilities() is being used rather then eliminating the use of getCapabilities() altogether!
* * *
Usage of getCapabilities ------- ------- ---
-------
The following is the usage of getCapabilities(), either directly or via
the wrapper method, get_capabilities() in libvirt/host.py:
- get_domain_ capabilities( )
- get_canonical_ machine_ type()
- has_hyperthread ing()
- supports_uefi()
- supports_ secure_ boot()
- supports_amd_sev()
- get_cpu_ model_names( )
"Get the cpu models based on host CPU arch -- :returns: a list of
cpu models which supported by the given CPU arch"
And the usage of host.get_ capabilities( ) in libvirt/driver.py:
- _do_quality_ warnings( )
- _get_guest_ cpu_model_ config( )
- _match_ cpu_model_ by_flags( )
- _get_guest_ cpu_config( )
- _get_host_ sysinfo_ serial_ hardware( )
- _check_ uefi_support( )
- _configure_ guest_by_ virt_type( )
- _guest_needs_pcie()
* * *
Perhaps we can start with evaluating these methods and see what can be replaced there:
- get_cpu_ model_names( ) cpu_model_ config( ) cpu_config( ) cpu_model_ by_flags( ) guest_by_ virt_type( )
- get_guest_
- _get_guest_
- _match_
- And probably _configure_