]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add synchronization in Block Device driver
authorYuriy Nesenenko <ynesenenko@mirantis.com>
Thu, 3 Dec 2015 14:28:31 +0000 (16:28 +0200)
committeryuriy_n <ynesenenko@mirantis.com>
Mon, 14 Dec 2015 14:50:44 +0000 (16:50 +0200)
commitd1869d0b1cf090b33e436171cc2844b936ebad52
tree0ce0aecc5c6304ca1aaa902ff11e83fb79b7ee35
parent1b3a5ea89369c13047715cc18a77fcb69262463d
Add synchronization in Block Device driver

Multiple calls can get the same device. This patch adds synchronization
to create_volume, delete_volume and create_cloned_volume to avoid race
conditions. The delete_volume method is modified to avoid code duplication
in the implementation of delete_snapshot method for snapshot in the next
patch. Also it adds update provider_location and host to mark device as
used to avoid race with other threads. It uses object notation instead
of dict notation to a volume and snapshot.

Change-Id: I0b8fb28dde367c3f34dd0b6b9d98372cfff65d45
Closes-Bug: #1335904
cinder/tests/unit/test_block_device.py
cinder/volume/drivers/block_device.py