libvirt: Collocate encryptor and volume driver calls
This change introduces new utility methods for attaching and detaching
frontend volume encryptors. These methods centralise the optional
fetching of encryption metadata associated with a volume, fetching of the
required encryptor and calls to detach or attach the encryptor.
These new utility methods are called either after initially connecting
to or before disconnecting from a volume. This ensures encryptors are
correctly connected when swapping volumes for example, where previously
no attempt was made to attach an encryptor to the target volume.
The request context is provided to swap_volume and various other config
generation related methods to allow for the lookup of the relevant
encryption metadata if it is not provided.
Reviewed: https:/ /review. openstack. org/460243 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=cd3eb60c2c0 0bcccfa9ccd4bf9 d1a96ae7a5cd88
Committed: https:/
Submitter: Zuul
Branch: master
commit cd3eb60c2c00bcc cfa9ccd4bf9d1a9 6ae7a5cd88
Author: Lee Yarwood <email address hidden>
Date: Mon Apr 24 19:23:44 2017 +0100
libvirt: Collocate encryptor and volume driver calls
This change introduces new utility methods for attaching and detaching
frontend volume encryptors. These methods centralise the optional
fetching of encryption metadata associated with a volume, fetching of the
required encryptor and calls to detach or attach the encryptor.
These new utility methods are called either after initially connecting
to or before disconnecting from a volume. This ensures encryptors are
correctly connected when swapping volumes for example, where previously
no attempt was made to attach an encryptor to the target volume.
The request context is provided to swap_volume and various other config
generation related methods to allow for the lookup of the relevant
encryption metadata if it is not provided.
Closes-bug: #1739593 54fca9d46ada367 7f18fe50022
Change-Id: Ica323b87fa85a4