Update git submodules
* Update nova from branch 'master'
- libvirt: harden Host.get_domain_capabilities()
Previously get_domain_capabilities() in nova.virt.libvirt.host.Host
assumed that 'q35' would be an acceptable fallback default for any
architecture if no default machine type was hardcoded in nova for that
architecture. This was incorrect on two levels:
1. q35 is specific to x86 architectures.
2. Even on x86 architectures, nova's current default is 'pc'.
(There is an initiative to update it to q35, but that has
not landed yet.)
Furthermore, we need to be able to cope with situations where nova
has no default machine type hardcoded, by relying on the default
returned from calling libvirt's getDomainCapabilities() API with
no machine type specified.[0]
So this commit makes the following changes:
- Convert nova.virt.libvirt.host.Host._get_domain_capabilities() to
take all arguments as optional kwargs which match the signature of
libvirt's getDomainCapabilities() function, allowing it to be called
with unspecified machine type.
- Refactor libvirt_utils.get_default_machine_type() to use a dictionary
of default arch to machine_type mappings, and default i686 and
x86_64 to 'pc'.
- Extend get_domain_capabilities() to register domcaps by both the
versioned name returned by libvirt (e.g. 'pc-i440fx-2.11') and the
alias that was requested (e.g. 'pc').
- Extend the LibvirtConfigDomainCaps class with machine_type and
machine_type_alias properties.
- Factor out the domain cap test data into a separate
fake_libvirt_data module, and add valid examples for several
architectures such as armv7, i686 and sparc. These will all be
included in the return value from Host.get_domain_capabilities()
since the list of architectures for which to call the API come from
fakelibvirt's getCapabilities() which already returns multiple guest
architectures.
- Add more test cases to validate the changes above.
[0] To work around a bug in older versions of the libvirt-python API,
it is necessary to explicitly pass None as the machine type
parameter:
https://www.mail-archive.com/libvir-list@redhat.com/msg182746.html
5004b4ad53
Co-Authored-By: Adam Spiers <aspiers@suse.com>
Related-Blueprint: blueprint image-metadata-prefiltering
Related-Blueprint: blueprint amd-sev-libvirt-support
Change-Id: Id86c6b23a32a66564c2e7c794104e3a553df947d
This commit is contained in:
parent
2ea52a884a
commit
51a0a9cef8
2
nova
2
nova
|
@ -1 +1 @@
|
|||
Subproject commit 1599e3cf68779eafaaa2b13a273d3bebd1379c19
|
||||
Subproject commit f1426d128ef504ce364828720ac1d08435dbdeb8
|
Loading…
Reference in New Issue