Skip to content

Commit c608c08

Browse files
committed
refactor(LVHDo*SR): rename to "LVMo*SR"
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.fr>
1 parent 3a7a198 commit c608c08

9 files changed

Lines changed: 90 additions & 90 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ SM_DRIVERS += ISO
1010
SM_DRIVERS += HBA
1111
SM_DRIVERS += Linstor
1212
SM_DRIVERS += LVM
13-
SM_DRIVERS += LVHDoISCSI
14-
SM_DRIVERS += LVHDoHBA
13+
SM_DRIVERS += LVMoISCSI
14+
SM_DRIVERS += LVMoHBA
1515
SM_DRIVERS += SHM
1616
SM_DRIVERS += SMB
17-
SM_DRIVERS += LVHDoFCoE
17+
SM_DRIVERS += LVMoFCoE
1818
SM_DRIVERS += CephFS
1919
SM_DRIVERS += GlusterFS
2020
SM_DRIVERS += XFS
@@ -205,9 +205,9 @@ install: build
205205
rm $(SM_STAGING)$(SM_DEST)/SHMSR
206206
cd $(SM_STAGING)$(SM_DEST) && rm -f LVMSR && ln -sf LVMSR.py LVHDSR
207207
cd $(SM_STAGING)$(SM_DEST) && rm -f RawISCSISR && ln -sf RawISCSISR.py ISCSISR
208-
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoISCSISR && ln -sf LVHDoISCSISR.py LVMoISCSISR
209-
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoHBASR && ln -sf LVHDoHBASR.py LVMoHBASR
210-
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoFCoESR && ln -sf LVHDoFCoESR.py LVMoFCoESR
208+
cd $(SM_STAGING)$(SM_DEST) && rm -f LVMoISCSISR && ln -sf LVMoISCSISR.py LVMoISCSISR
209+
cd $(SM_STAGING)$(SM_DEST) && rm -f LVMoHBASR && ln -sf LVMoHBASR.py LVMoHBASR
210+
cd $(SM_STAGING)$(SM_DEST) && rm -f LVMoFCoESR && ln -sf LVMoFCoESR.py LVMoFCoESR
211211
ln -sf $(SM_DEST)mpathutil.py $(SM_STAGING)/sbin/mpathutil
212212
install -m 755 drivers/02-vhdcleanup $(SM_STAGING)$(MASTER_SCRIPT_DEST)
213213
install -m 755 drivers/linstor-manager $(SM_STAGING)$(PLUGIN_SCRIPT_DEST)

drivers/LVMSR.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def _refresh_size(self):
452452
Return true if all paths/devices agree on the same size.
453453
"""
454454
if hasattr(self, 'SCSIid'):
455-
# LVHDoHBASR, LVHDoISCSISR
455+
# LVMoHBASR, LVMoISCSISR
456456
return scsiutil.refresh_lun_size_by_SCSIid(getattr(self, 'SCSIid'))
457457
else:
458458
# LVMSR
@@ -476,7 +476,7 @@ def _expand_size(self):
476476
if totaldevicesize >= (currentvgsize + resizethreshold):
477477
try:
478478
if hasattr(self, 'SCSIid'):
479-
# LVHDoHBASR, LVHDoISCSISR might have slaves
479+
# LVMoHBASR, LVMoISCSISR might have slaves
480480
scsiutil.refresh_lun_size_by_SCSIid_on_slaves(self.session,
481481
getattr(self, 'SCSIid'))
482482
util.SMlog("LVMSR._expand_size for %s will resize the pv." %
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# along with this program; if not, write to the Free Software Foundation, Inc.,
1616
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1717
#
18-
# LVHDoFCoESR: LVHD over Fibre Channel over Ethernet driver
18+
# LVMoFCoESR: LVM over Fibre Channel over Ethernet driver
1919
#
2020

2121
from sm_typing import override
2222

2323
import SR
2424
import VDI
25-
import LVHDoHBASR
25+
import LVMoHBASR
2626
import LVMSR
2727
import SRCommand
2828
import sys
@@ -41,8 +41,8 @@
4141
defaults to thick)']]
4242

4343
DRIVER_INFO = {
44-
'name': 'LVHD over FCoE',
45-
'description': 'SR plugin which represents disks as VHDs on Logical \
44+
'name': 'LVM over FCoE',
45+
'description': 'SR plugin which represents disks as VHDs and QCOW2 on Logical \
4646
Volumes within a Volume Group created on a FCoE LUN',
4747
'vendor': 'Citrix Systems Inc',
4848
'copyright': '(C) 2015 Citrix Systems Inc',
@@ -53,9 +53,9 @@
5353
}
5454

5555

56-
class LVHDoFCoESR(LVHDoHBASR.LVHDoHBASR):
56+
class LVMoFCoESR(LVMoHBASR.LVMoHBASR):
5757

58-
"""LVHD over FCoE storage repository"""
58+
"""LVM over FCoE storage repository"""
5959

6060
@override
6161
@staticmethod
@@ -93,13 +93,13 @@ def load(self, sr_uuid) -> None:
9393

9494
@override
9595
def vdi(self, uuid) -> VDI.VDI:
96-
return LVHDoFCoEVDI(self, uuid)
96+
return LVMoFCoEVDI(self, uuid)
9797

9898

99-
class LVHDoFCoEVDI(LVHDoHBASR.LVHDoHBAVDI):
99+
class LVMoFCoEVDI(LVMoHBASR.LVMoHBAVDI):
100100
pass
101101

102102
if __name__ == '__main__':
103-
SRCommand.run(LVHDoFCoESR, DRIVER_INFO)
103+
SRCommand.run(LVMoFCoESR, DRIVER_INFO)
104104
else:
105-
SR.registerSR(LVHDoFCoESR)
105+
SR.registerSR(LVMoFCoESR)
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# along with this program; if not, write to the Free Software Foundation, Inc.,
1616
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1717
#
18-
# LVHDoISCSISR: LVHD over Hardware HBA LUN driver, e.g. Fibre Channel or
18+
# LVMoISCSISR: LVM over Hardware HBA LUN driver, e.g. Fibre Channel or
1919
# hardware based iSCSI
2020
#
2121

@@ -47,7 +47,7 @@
4747
['allocation', 'Valid values are thick or thin (optional, defaults to thick)']]
4848

4949
DRIVER_INFO = {
50-
'name': 'LVHD over FC',
50+
'name': 'LVM over FC',
5151
'description': 'SR plugin which represents disks as VHDs on Logical Volumes within a Volume Group created on an HBA LUN, e.g. hardware-based iSCSI or FC support',
5252
'vendor': 'Citrix Systems Inc',
5353
'copyright': '(C) 2008 Citrix Systems Inc',
@@ -58,8 +58,8 @@
5858
}
5959

6060

61-
class LVHDoHBASR(LVMSR.LVMSR):
62-
"""LVHD over HBA storage repository"""
61+
class LVMoHBASR(LVMSR.LVMSR):
62+
"""LVM over HBA storage repository"""
6363

6464
@override
6565
@staticmethod
@@ -111,14 +111,14 @@ def load(self, sr_uuid) -> None:
111111
raise xs_errors.XenError('ConfigSCSIid')
112112

113113
self.SCSIid = self.dconf['SCSIid']
114-
super(LVHDoHBASR, self).load(sr_uuid)
114+
super(LVMoHBASR, self).load(sr_uuid)
115115

116116
@override
117117
def create(self, sr_uuid, size) -> None:
118118
self.hbasr.attach(sr_uuid)
119119
if self.mpath == "true":
120120
self.mpathmodule.refresh(self.SCSIid, 0)
121-
self._pathrefresh(LVHDoHBASR)
121+
self._pathrefresh(LVMoHBASR)
122122
try:
123123
LVMSR.LVMSR.create(self, sr_uuid, size)
124124
finally:
@@ -137,7 +137,7 @@ def attach(self, sr_uuid) -> None:
137137
for file in os.listdir(path):
138138
self.block_setscheduler('%s/%s' % (path, file))
139139

140-
self._pathrefresh(LVHDoHBASR)
140+
self._pathrefresh(LVMoHBASR)
141141
if not os.path.exists(self.dconf['device']):
142142
# Force a rescan on the bus
143143
self.hbasr._init_hbadict()
@@ -156,10 +156,10 @@ def scan(self, sr_uuid) -> None:
156156
if 'device' not in self.dconf or not os.path.exists(self.dconf['device']):
157157
util.SMlog("@@@@@ path does not exists")
158158
self.mpathmodule.refresh(self.SCSIid, 0)
159-
self._pathrefresh(LVHDoHBASR)
159+
self._pathrefresh(LVMoHBASR)
160160
self._setMultipathableFlag(SCSIid=self.SCSIid)
161161
else:
162-
self._pathrefresh(LVHDoHBASR)
162+
self._pathrefresh(LVMoHBASR)
163163
LVMSR.LVMSR.scan(self, sr_uuid)
164164

165165
@override
@@ -180,7 +180,7 @@ def probe(self) -> str:
180180
self.mpathmodule.refresh(self.SCSIid, 0)
181181

182182
try:
183-
self._pathrefresh(LVHDoHBASR)
183+
self._pathrefresh(LVMoHBASR)
184184
result = LVMSR.LVMSR.probe(self)
185185
if self.mpath == "true":
186186
self.mpathmodule.reset(self.SCSIid, explicit_unmap=True)
@@ -217,7 +217,7 @@ def _remove_device_nodes(self):
217217

218218
@override
219219
def delete(self, sr_uuid) -> None:
220-
self._pathrefresh(LVHDoHBASR)
220+
self._pathrefresh(LVMoHBASR)
221221
try:
222222
LVMSR.LVMSR.delete(self, sr_uuid)
223223
finally:
@@ -227,13 +227,13 @@ def delete(self, sr_uuid) -> None:
227227

228228
@override
229229
def vdi(self, uuid) -> VDI.VDI:
230-
return LVHDoHBAVDI(self, uuid)
230+
return LVMoHBAVDI(self, uuid)
231231

232232

233-
class LVHDoHBAVDI(LVMSR.LVMVDI):
233+
class LVMoHBAVDI(LVMSR.LVMVDI):
234234
@override
235235
def generate_config(self, sr_uuid, vdi_uuid) -> str:
236-
util.SMlog("LVHDoHBAVDI.generate_config")
236+
util.SMlog("LVMoHBAVDI.generate_config")
237237
if not lvutil._checkLV(self.path):
238238
raise xs_errors.XenError('VDIUnavailable')
239239
dict = {}
@@ -250,14 +250,14 @@ def generate_config(self, sr_uuid, vdi_uuid) -> str:
250250

251251
@override
252252
def attach_from_config(self, sr_uuid, vdi_uuid) -> str:
253-
util.SMlog("LVHDoHBAVDI.attach_from_config")
253+
util.SMlog("LVMoHBAVDI.attach_from_config")
254254
self.sr.hbasr.attach(sr_uuid)
255255
if self.sr.mpath == "true":
256256
self.sr.mpathmodule.refresh(self.sr.SCSIid, 0)
257257
try:
258258
return self.attach(sr_uuid, vdi_uuid)
259259
except:
260-
util.logException("LVHDoHBAVDI.attach_from_config")
260+
util.logException("LVMoHBAVDI.attach_from_config")
261261
raise xs_errors.XenError('SRUnavailable', \
262262
opterr='Unable to attach the heartbeat disk')
263263

@@ -267,6 +267,6 @@ def match_scsidev(s):
267267
return regex.search(s, 0)
268268

269269
if __name__ == '__main__':
270-
SRCommand.run(LVHDoHBASR, DRIVER_INFO)
270+
SRCommand.run(LVMoHBASR, DRIVER_INFO)
271271
else:
272-
SR.registerSR(LVHDoHBASR)
272+
SR.registerSR(LVMoHBASR)
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# along with this program; if not, write to the Free Software Foundation, Inc.,
1616
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1717
#
18-
# LVHDoISCSISR: LVHD over ISCSI software initiator SR driver
18+
# LVMoISCSISR: LVM over ISCSI software initiator SR driver
1919
#
2020

2121
from sm_typing import override
@@ -60,7 +60,7 @@
6060
['allocation', 'Valid values are thick or thin (optional, defaults to thick)']]
6161

6262
DRIVER_INFO = {
63-
'name': 'LVHD over iSCSI',
63+
'name': 'LVM over iSCSI',
6464
'description': 'SR plugin which represents disks as Logical Volumes within a Volume Group created on an iSCSI LUN',
6565
'vendor': 'Citrix Systems Inc',
6666
'copyright': '(C) 2008 Citrix Systems Inc',
@@ -71,8 +71,8 @@
7171
}
7272

7373

74-
class LVHDoISCSISR(LVMSR.LVMSR):
75-
"""LVHD over ISCSI storage repository"""
74+
class LVMoISCSISR(LVMSR.LVMSR):
75+
"""LVM over ISCSI storage repository"""
7676

7777
@override
7878
@staticmethod
@@ -178,7 +178,7 @@ def create_iscsi_sessions(self, sr_uuid):
178178
dconf['multiSession'] = IQNstring
179179
self.session.xenapi.PBD.set_device_config(pbd, dconf)
180180
except Exception as exc:
181-
util.logException("LVHDoISCSISR.load")
181+
util.logException("LVMoISCSISR.load")
182182
saved_exc = exc
183183
try:
184184
self.iscsi = self.iscsiSRs[0]
@@ -440,7 +440,7 @@ def create(self, sr_uuid, size) -> None:
440440
self.iscsi.attach(sr_uuid)
441441
try:
442442
self.iscsi._attach_LUN_bySCSIid(self.SCSIid)
443-
self._pathrefresh(LVHDoISCSISR)
443+
self._pathrefresh(LVMoISCSISR)
444444
LVMSR.LVMSR.create(self, sr_uuid, size)
445445
except Exception as inst:
446446
self.iscsi.detach(sr_uuid)
@@ -449,7 +449,7 @@ def create(self, sr_uuid, size) -> None:
449449

450450
@override
451451
def delete(self, sr_uuid) -> None:
452-
self._pathrefresh(LVHDoISCSISR)
452+
self._pathrefresh(LVMoISCSISR)
453453
LVMSR.LVMSR.delete(self, sr_uuid)
454454
for i in self.iscsiSRs:
455455
i.detach(sr_uuid)
@@ -485,7 +485,7 @@ def attach(self, sr_uuid) -> None:
485485
for a in self.iscsi.adapter:
486486
scsiutil.rescan([self.iscsi.adapter[a]])
487487

488-
self._pathrefresh(LVHDoISCSISR)
488+
self._pathrefresh(LVMoISCSISR)
489489

490490
# Check that we only have PVs for the volume group with the expected SCSI ID
491491
lvutil.checkPVScsiIds(self.vgname, self.SCSIid)
@@ -511,7 +511,7 @@ def detach(self, sr_uuid) -> None:
511511

512512
@override
513513
def scan(self, sr_uuid) -> None:
514-
self._pathrefresh(LVHDoISCSISR)
514+
self._pathrefresh(LVMoISCSISR)
515515
if self.mpath == "true":
516516
for i in self.iscsiSRs:
517517
try:
@@ -539,7 +539,7 @@ def probe(self) -> str:
539539

540540
self.iscsi.attach(self.uuid)
541541
self.iscsi._attach_LUN_bySCSIid(self.SCSIid)
542-
self._pathrefresh(LVHDoISCSISR)
542+
self._pathrefresh(LVMoISCSISR)
543543
out = LVMSR.LVMSR.probe(self)
544544
self.iscsi.detach(self.uuid)
545545
return out
@@ -560,13 +560,13 @@ def check_sr(self, sr_uuid) -> None:
560560

561561
@override
562562
def vdi(self, uuid) -> VDI.VDI:
563-
return LVHDoISCSIVDI(self, uuid)
563+
return LVMoISCSIVDI(self, uuid)
564564

565565

566-
class LVHDoISCSIVDI(LVMSR.LVMVDI):
566+
class LVMoISCSIVDI(LVMSR.LVMVDI):
567567
@override
568568
def generate_config(self, sr_uuid, vdi_uuid) -> str:
569-
util.SMlog("LVHDoISCSIVDI.generate_config")
569+
util.SMlog("LVMoISCSIVDI.generate_config")
570570
if not lvutil._checkLV(self.path):
571571
raise xs_errors.XenError('VDIUnavailable')
572572
dict = {}
@@ -588,18 +588,18 @@ def generate_config(self, sr_uuid, vdi_uuid) -> str:
588588

589589
@override
590590
def attach_from_config(self, sr_uuid, vdi_uuid) -> str:
591-
util.SMlog("LVHDoISCSIVDI.attach_from_config")
591+
util.SMlog("LVMoISCSIVDI.attach_from_config")
592592
try:
593593
self.sr.iscsi.attach(sr_uuid)
594594
self.sr.iscsi._attach_LUN_bySCSIid(self.sr.SCSIid)
595595
return LVMSR.LVMVDI.attach(self, sr_uuid, vdi_uuid)
596596
except:
597-
util.logException("LVHDoISCSIVDI.attach_from_config")
597+
util.logException("LVMoISCSIVDI.attach_from_config")
598598
raise xs_errors.XenError('SRUnavailable', \
599599
opterr='Unable to attach the heartbeat disk')
600600

601601

602602
if __name__ == '__main__':
603-
SRCommand.run(LVHDoISCSISR, DRIVER_INFO)
603+
SRCommand.run(LVMoISCSISR, DRIVER_INFO)
604604
else:
605-
SR.registerSR(LVHDoISCSISR)
605+
SR.registerSR(LVMoISCSISR)

tests/test_BaseISCSI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def setUp(self) -> None:
3636
mock_xenapi = xenapi_patcher.start()
3737
mock_xenapi.xapi_local.return_value = self.mock_session
3838

39-
copy_patcher = mock.patch('LVHDoISCSISR.SR.copy.deepcopy')
39+
copy_patcher = mock.patch('LVMoISCSISR.SR.copy.deepcopy')
4040
self.mock_copy = copy_patcher.start()
4141

4242
def deepcopy(to_copy):

0 commit comments

Comments
 (0)