nova/nova/virt/libvirt
Matthew Booth b66b7d4f9d libvirt: Pass instance to connect_volume and disconnect_volume
When we support multi-attach volumes, for volume drivers which must
make host state changes (eg mount/unmount) it is no longer enough to
know only which volume is being connected; we must also know which
instance it is being attached to. Consider the following sequence of
calls, and the expected behaviour of the volume driver:

 * connect_volume(conn_info)
     connect the volume
 * connect_volume(conn_info)
     do nothing (volume is already connected)
 * disconnect_volume(conn_info)
     disconnect the volume
 * disconnect_volume(conn_info)
     do nothing (volume is already disconnected)

Now consider these were actually connections to different instances:

 * connect_volume(conn_info, A)
     connect the volume
 * connect_volume(conn_info, B)
     do nothing (volume is already connected)
 * disconnect_volume(conn_info, A)
     ++ do nothing (volume is still connected to B)
 * disconnect_volume(conn_info, B)
     disconnect the volume

IOW, it is not possible for the driver to determine the correct
behaviour unless it also knows which instance is being attached.

This is a non functional change which simply adds instance as an
argument to all connect_volume and disconnect_volume calls in libvirt
volume drivers. It is effectively a part of change I3155984d. I have
split it as it is mechanical, it touches a large number of files
which make the substantive change harder to read, and to isolate the
substantive change from merge conflicts caused by this change.

We also add a utility test class: SubclassSignatureTestCase. This is
used in this patch to ensure we have found all connect_volume and
disconnect_volume methods which need to be updated. We implement it in
the top level tests module as we expect it to be useful elsewhere.

This patch was previously submitted as change I658d7ab5 but had to be
reverted as it failed to update the signatures of several volume
drivers. This is also what has prompted the addition of
SubclassSignatureTestCase, which ensures this hasn't happened again.

Change-Id: I01c908add1312063f0db724110f7e5927ff281ff
2017-05-08 11:31:11 -04:00
..
storage Port libvirt.storage.test_rbd to Python 3 2016-12-15 13:38:53 +00:00
volume libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py Merge "Fix root_device_name for Xen" 2017-01-31 18:56:46 +00:00
compat.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
config.py Read NIC features in libvirt 2017-04-11 14:38:19 +00:00
designer.py libvirt: conditionally set script path for ethernet vif types 2017-03-21 14:12:39 -04:00
driver.py libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
firewall.py Merge "libvirt: Ignore 'allow_same_net_traffic' for port filters" 2017-04-05 20:27:49 +00:00
guest.py Spelling error "paramenter" 2017-04-17 16:40:50 +08:00
host.py Merge "Avoid multiple initializations of Host class" 2017-02-25 14:54:01 +00:00
imagebackend.py Merge "get_model method missing for Ploop image" 2017-03-20 13:33:38 +00:00
imagecache.py Don't check for file type in _find_base_file 2017-04-27 10:42:26 +01:00
instancejobtracker.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
migration.py Use flake8-import-order 2017-03-06 06:50:23 -08:00
utils.py Merge "libvirt: workaround findmnt behaviour change" 2017-02-03 13:37:23 +00:00
vif.py Add lan9118 as valid nic for hw_vif_model property for qemu 2017-03-22 17:06:29 +00:00