cinder/cinder/volume
John Griffith c42273fbc1 Make sure device support Direct before setting
We added '-t none' option to the qemu-img convert operation
in image_utils.py a while back to accomodate a couple of
backend devices that didn't flush writes on disconnect.
(Change: I7a04f683add8c23b9125fe837c4048ccc3ac224d)

The only problem here is that some backend devices don't
support Direct mode and raise an exception and fail when
setting this option.

This patch adds a simple check using dd to see if the dest
supports the Direct flag and only sets '-t none' if the device
does in fact support it.

Additionally it was brought up that even yet other backends
are using file devices not blk devices.  In their case setting
Direct will still work, however it's sub-optimal as qemu-convert
has internal mechanisms to make sure flushing etc are done
correctly and efficiently for those devices.  So to accomodate
that particular use case I'm also adding a check if blk dev
that can be used for determining whether to set Direct for the
qemu-convert process.

Change-Id: I34127ac373ceadcfb6fc2662628b1a91eb7b0046
Closes-Bug: 1375487
2014-10-08 16:17:14 -06:00
..
drivers Merge "Windows SMBFS: Handle volume_name in _qemu_img_info" 2014-10-03 01:00:47 +00:00
flows Clarify InvalidInput exception when the size is missing 2014-10-02 09:44:12 -07:00
__init__.py Remove vim header 2013-12-30 18:53:02 -06:00
api.py Merge "Verify requested size in volume.api create" 2014-09-19 02:42:15 +00:00
configuration.py Remove vim header 2013-12-30 18:53:02 -06:00
driver.py Revert iSCSI Target objects as independent objects 2014-09-06 20:31:55 -07:00
iscsi.py Use oslo.i18n 2014-08-08 17:26:41 -05:00
manager.py Merge "Delete consistency group failed" 2014-09-13 15:30:44 +00:00
qos_specs.py Use oslo.i18n 2014-08-08 17:26:41 -05:00
rpcapi.py Fix possible race condition for accept transfer 2014-09-08 08:54:52 -07:00
utils.py Make sure device support Direct before setting 2014-10-08 16:17:14 -06:00
volume_types.py Use oslo.i18n 2014-08-08 17:26:41 -05:00