]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Report discard support for Dell SC connections
authorSean McGinnis <sean_mcginnis@dell.com>
Fri, 8 Jan 2016 14:43:35 +0000 (08:43 -0600)
committerSean McGinnis <sean_mcginnis@dell.com>
Mon, 11 Jan 2016 19:11:33 +0000 (13:11 -0600)
Add reporting of discard in the properties returned from
initialize_connection. Dell SC arrays support trim/discard
with no special configuration needed, so this can always
be set to true.

Change-Id: Ib0136369e230b5219b2b3994d17b6b31a9aba69f

cinder/tests/unit/test_dellfc.py
cinder/volume/drivers/dell/dell_storagecenter_fc.py
cinder/volume/drivers/dell/dell_storagecenter_iscsi.py

index 05f64b04a0c900d7743e2fa90a82c0dcf2fc0dfd..991b7c121335bf5e18a5e4ac0b982b35ae75f233 100644 (file)
@@ -204,7 +204,8 @@ class DellSCSanFCDriverTestCase(test.TestCase):
         connector = self.connector
         res = self.driver.initialize_connection(volume, connector)
         expected = {'data':
-                    {'initiator_target_map':
+                    {'discard': True,
+                     'initiator_target_map':
                      {u'21000024FF30441C': [u'5000D31000FCBE35'],
                       u'21000024FF30441D': [u'5000D31000FCBE3D']},
                      'target_discovered': True,
index 40853b0738f21634b2b72d236b9ce459430aec06..0d273e7c3b35adfd56c8f898c52d098679424aec 100644 (file)
@@ -98,9 +98,9 @@ class DellStorageCenterFCDriver(dell_storagecenter_common.DellCommonDriver,
                                              'target_discovered': True,
                                              'target_wwn': targets,
                                              'initiator_target_map':
-                                             init_targ_map}}
-                            LOG.debug('Return FC data:')
-                            LOG.debug(data)
+                                             init_targ_map,
+                                             'discard': True}}
+                            LOG.debug('Return FC data: %s', data)
                             return data
                         LOG.error(_LE('Lun mapping returned null!'))
 
index 0da98c9a6a7f2bfe4a7b5724496074d916ead5e1..434c01ee9123189ef265d27287e87450cea8d439 100644 (file)
@@ -123,6 +123,7 @@ class DellStorageCenterISCSIDriver(dell_storagecenter_common.DellCommonDriver,
                                                                 port))
 
                         # Return our iscsi properties.
+                        iscsiprops['discard'] = True
                         return {'driver_volume_type': 'iscsi',
                                 'data': iscsiprops}
             # Re-raise any backend exception.