Skip to content

Commit e2d8514

Browse files
refactor: call gc_stop_service in cleanup.abort instead of SR.detach to match upstream request
Signed-off-by: Mathieu Labourier <mathieu.labourier@vates.tech>
1 parent e5fa2de commit e2d8514

10 files changed

Lines changed: 2 additions & 10 deletions

File tree

drivers/CephFSSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def detach(self, sr_uuid) -> None:
216216
self.unmount(self.mountpoint, True)
217217
os.unlink(self.path)
218218
self.attached = False
219-
cleanup.stop_gc_service(sr_uuid)
220219

221220
@override
222221
def create(self, sr_uuid, size) -> None:

drivers/FileSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ def detach(self, sr_uuid) -> None:
197197
except Exception as e:
198198
raise xs_errors.XenError('SRInUse', opterr=str(e))
199199
self.attached = False
200-
cleanup.stop_gc_service(sr_uuid)
201200

202201
@override
203202
def scan(self, sr_uuid) -> None:

drivers/GlusterFSSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def detach(self, sr_uuid) -> None:
196196
self.unmount(self.mountpoint, True)
197197
os.unlink(self.path)
198198
self.attached = False
199-
cleanup.stop_gc_service(sr_uuid)
200199

201200
@override
202201
def create(self, sr_uuid, size) -> None:

drivers/LVHDSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ def detach(self, uuid) -> None:
668668
# However, we should still delete lock files on slaves as it is the
669669
# only place to do so.
670670
self._cleanup(self.isMaster)
671-
cleanup.stop_gc_service(uuid)
672671

673672
@override
674673
def forget_vdi(self, uuid) -> None:

drivers/LinstorSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ def attach(self, uuid) -> None:
746746
def detach(self, uuid) -> None:
747747
util.SMlog('LinstorSR.detach for {}'.format(self.uuid))
748748
cleanup.abort(self.uuid)
749-
cleanup.stop_gc_service(uuid)
750749

751750
@override
752751
@_locked_load

drivers/MooseFSSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def detach(self, sr_uuid) -> None:
210210
os.chdir(SR.MOUNT_BASE)
211211
self.unmount(self.mountpoint, True)
212212
self.attached = False
213-
cleanup.stop_gc_service(sr_uuid)
214213

215214
@override
216215
def create(self, sr_uuid, size) -> None:

drivers/NFSSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def detach(self, sr_uuid) -> None:
206206
raise xs_errors.XenError('NFSUnMount', opterr=exc.errstr)
207207

208208
self.attached = False
209-
cleanup.stop_gc_service(sr_uuid)
210209

211210
@override
212211
def create(self, sr_uuid, size) -> None:

drivers/SMBSR.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ def detach(self, sr_uuid) -> None:
248248
raise xs_errors.XenError('SMBUnMount', opterr=exc.errstr)
249249

250250
self.attached = False
251-
cleanup.stop_gc_service(sr_uuid)
252251

253252
@override
254253
def create(self, sr_uuid, size) -> None:

drivers/cleanup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3948,6 +3948,7 @@ def abort(srUuid, soft=False):
39483948
"""Abort GC/coalesce if we are currently GC'ing or coalescing a VDI pair.
39493949
"""
39503950
if _abort(srUuid, soft):
3951+
stop_gc_service(srUuid)
39513952
Util.log("abort: releasing the process lock")
39523953
lockGCActive.release()
39533954
return True

tests/test_cleanup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ def test_lock_released_by_abort_when_held(
407407
cleanup.lockGCActive = TestRelease()
408408
cleanup.lockGCActive.release = mock.Mock(return_value=None)
409409

410-
ret = cleanup.abort(mock_sr, False)
411-
410+
ret = cleanup.abort(str(mock_sr.uuid), False)
412411
# Pass on the return from _abort.
413412
self.assertEqual(True, ret)
414413

0 commit comments

Comments
 (0)