]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Small optimization in Block Device driver
authorYuriy Nesenenko <ynesenenko@mirantis.com>
Fri, 4 Sep 2015 15:25:44 +0000 (18:25 +0300)
committerYuriy Nesenenko <ynesenenko@mirantis.com>
Thu, 1 Oct 2015 10:31:40 +0000 (13:31 +0300)
commit11bbc450c33703dba8b78c56556637e49c420376
tree153b6163b3cda17f3adad89c74c7fee52d2756b7
parentccd1692325c1b2681d8552bc4b2551100ad793df
Small optimization in Block Device driver

Method _devices_sizes() in Block Device driver invokes N times
_get_device_size(device) to get devices sizes. It can be done by
executing one command: blockdev --getsize64 /dev/loop1 /dev/loop2.
In such a way we take the devices' sizes in bytes and convert them
to Megabytes.

Change-Id: I0aba86239b4c580a0b12202a8f7fc863dab6fecd
cinder/tests/unit/test_block_device.py
cinder/volume/drivers/block_device.py