Skip to content

Commit 18a6f14

Browse files
committed
feat(filesr): support vdi_revert on FileSR
* Support vdi_revert from xapi * Enable VDI_REVERT capability on FileSR * Implement vdi revert on File based SRs * Support CBT on vdi revert * Support vdi_revert rollback with journal in case of catastrophic failure * Fix ZFSSR tests * Add `tap_pause` context manager to base `VDI` object * add generic journaling capabilities * Fix permission on nfs-on-slave plugin Signed-off-by: Antoine Bartuccio <antoine.bartuccio@vates.tech>
1 parent c4dce9e commit 18a6f14

18 files changed

Lines changed: 679 additions & 63 deletions

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ SM_LIBS += mpathcount
5656
SM_LIBS += refcounter
5757
SM_LIBS += journaler
5858
SM_LIBS += fjournaler
59+
SM_LIBS += jutils
5960
SM_LIBS += lock
6061
SM_LIBS += flock
6162
SM_LIBS += lock_queue

drivers/CephFSSR.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"VDI_CREATE", "VDI_DELETE", "VDI_ATTACH", "VDI_DETACH",
4646
"VDI_UPDATE", "VDI_CLONE", "VDI_SNAPSHOT", "VDI_RESIZE", "VDI_MIRROR",
4747
"VDI_GENERATE_CONFIG",
48-
"VDI_RESET_ON_BOOT/2", "ATOMIC_PAUSE"]
48+
"VDI_RESET_ON_BOOT/2", "ATOMIC_PAUSE", "VDI_REVERT"]
4949

5050
CONFIGURATION = [
5151
['server', 'Ceph server(s) (required, ex: "192.168.0.12" or "10.10.10.10,10.10.10.26")'],
@@ -120,6 +120,7 @@ def load(self, sr_uuid) -> None:
120120
self.linkpath = os.path.join(self.mountpoint, sr_uuid or "")
121121
self.path = os.path.join(SR.MOUNT_BASE, sr_uuid)
122122
self._check_o_direct()
123+
self._undo_all_journals()
123124

124125
def checkmount(self):
125126
return util.ioretry(lambda: ((util.pathexists(self.mountpoint) and

drivers/EXTSR.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"VDI_UPDATE", "VDI_CLONE", "VDI_SNAPSHOT", "VDI_RESIZE", "VDI_MIRROR",
3939
"VDI_GENERATE_CONFIG",
4040
"VDI_RESET_ON_BOOT/2", "ATOMIC_PAUSE", "VDI_CONFIG_CBT",
41-
"VDI_ACTIVATE", "VDI_DEACTIVATE", "THIN_PROVISIONING", "VDI_READ_CACHING"]
41+
"VDI_ACTIVATE", "VDI_DEACTIVATE", "THIN_PROVISIONING", "VDI_READ_CACHING",
42+
"VDI_REVERT"]
4243

4344
CONFIGURATION = [['device', 'local device path (required) (e.g. /dev/sda3)']]
4445

@@ -75,6 +76,7 @@ def load(self, sr_uuid) -> None:
7576
self.remotepath = os.path.join("/dev", self.vgname, sr_uuid)
7677
self.attached = self._checkmount()
7778
self.driver_config = DRIVER_CONFIG
79+
self._undo_all_journals()
7880

7981
@override
8082
def delete(self, sr_uuid) -> None:

0 commit comments

Comments
 (0)