nova/nova
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
..
CA
api Merge "Use plain routes list for os-assisted-volume-snapshots endpoint" 2017-05-04 12:21:01 +00:00
cells Merge "remove log translation tags from nova.cells" 2017-04-21 15:24:59 +00:00
cloudpipe Rename security_group parameter in compute.API:create 2016-11-10 11:25:43 -05:00
cmd Remove nova-cert 2017-04-27 22:28:01 -04:00
common cors: update default configuration in config 2016-11-05 20:17:42 -04:00
compute Merge "Catching OverQuota Exception" 2017-05-04 11:10:03 +00:00
conductor Make conductor ask scheduler to limit migrates to same cell 2017-03-29 07:12:31 -07:00
conf Merge "conf: Deprecate 'default_floating_pool'" 2017-05-04 11:15:20 +00:00
console Add RPC version aliases for Ocata 2017-02-27 18:37:48 +04:00
consoleauth Make consoleauth target the proper cell 2017-03-07 15:33:50 -08:00
db Add ability to query for ComputeNodes by their mapped value 2017-04-27 19:50:59 -04:00
hacking remove hacking rule that enforces log translation 2017-03-16 09:56:21 -04:00
image Use cursive for signature verification 2017-03-28 01:41:41 -07:00
ipv6 Fix test_ipv6 and simplify to_global() 2016-06-28 20:42:32 +02:00
keymgr Deprecate barbican options 2016-07-29 15:36:28 -05:00
locale Imported Translations from Zanata 2017-03-03 10:09:38 +00:00
network Merge "neutron: retrieve physical network name from a multi-provider network" 2017-05-04 13:50:22 +00:00
notifications Transform instance.volume_attach notification 2017-05-02 16:00:23 -04:00
objects Add ability to query for ComputeNodes by their mapped value 2017-04-27 19:50:59 -04:00
pci Modify PciPassthroughFilter to accept lists 2017-04-11 19:49:07 +00:00
policies Merge "Add policy description for Servers IPs" 2017-05-04 03:55:22 +00:00
scheduler Merge "Add reserved_host_cpus option" 2017-04-28 23:50:46 +00:00
servicegroup Don't use 'updated_at' to check service's status 2016-12-08 09:51:03 +00:00
tests libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
virt libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
vnc
volume Catching OverQuota Exception 2017-05-03 19:00:34 +00:00
wsgi Clarify the language in the apache wsgi sample 2017-02-02 15:43:25 -08:00
__init__.py
availability_zones.py Make os-availability-zones know about cells 2017-03-15 11:02:58 -07:00
baserpc.py
block_device.py db: Add attachment_id to block_device_mapping 2017-03-16 15:26:33 -04:00
cache_utils.py remove log translation tags from nova.cells 2017-04-10 14:48:07 +00:00
config.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
context.py Temporarily untarget context when deleting from cell0 2017-03-13 13:45:03 -04:00
crypto.py
debugger.py
exception.py Merge "libvirt: Always disconnect_volume after rebase failures" 2017-04-26 11:39:46 +00:00
exception_wrapper.py Short circuit notifications when not enabled 2017-03-30 22:32:14 +00:00
filters.py
hooks.py
i18n.py
loadables.py
manager.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
policy.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00
profiler.py Integrate OSProfiler and Nova 2017-01-18 15:00:14 +07:00
quota.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00
rpc.py Clean up ClientRouter debt 2017-04-25 09:58:26 -07:00
safe_utils.py
service.py Remove nova-cert 2017-04-27 22:28:01 -04:00
service_auth.py Add service_token for nova-cinder interaction 2017-01-11 15:49:16 +00:00
test.py libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
utils.py Fix some reST field lists in docstrings 2017-03-23 09:25:37 +08:00
version.py
weights.py Correct some spelling errors 2017-02-25 02:45:30 +00:00
wsgi.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00