Comment 2 for bug 2039803

Revision history for this message
Kashyap Chamarthy (kashyapc) wrote (last edit ):

I just did a quick audit of getCapabilities() in Nova upstream (`git describe`: 28.0.0-26-g6094a682917), and here is it.

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()

    * * *

I think we can start with evaluating these methods and see what can be replaced there:

  - get_cpu_model_names()
  - get_guest_cpu_model_config()
  - _get_guest_cpu_config()
  - _match_cpu_model_by_flags()
  - And probably _configure_guest_by_virt_type()