CP-49249: Implement SMAPIv3 CBT Forwarding #5675
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes populate the stubs in
xapi-storage-script
with the logic required for forwarding CBT-related functionality toxapi-storage-plugins
. Specifically, it will enable changed block tracking between snapshot VDIs whose storage substrate is XFS (local) or GFS2 (pool-wide).This functionality has been tested and looks to be working (the primary logic is on the storage plugins side, not ours). This set of changes shouldn't cause any breakage as the SMAPIv3 plugins are meant to be guarded to not advertise this capability to XAPI.
The style of the changes is up for discussion. I'm not fond of much of the style in
xapi-storage-script
; it nests monads in awkward ways (the kind of ways that motivate monad transformers in a language like Haskell) with undocumented details (e.g.Attached_SRs
ensures an SR's UUID string gets mapped to somewhere, typically/run/sr-mount/...
- otherwise the associated python plugins can't resolve them). Furthermore, the changes predate OCaml's addition oflet
-operators, so it's all very much infix monadic bind>>=
everywhere. I don't like infix@@
usage generally, as in my current commit, but it is a good visual marker.All that said: I'd rather not play more type tetris where it's unnecessary.
There exists another branch by psafont that cleans up a lot of
xapi-storage-script
, so I'd push for those kind of sweeping changes in the long run rather than make isolated syntax changes ad nauseam.This PR also includes relevant lifecycle updates from previous stuff, so if any fixup commits are pushed on top, a selective squash should be done to preserve that history (no github merge strategies). Or, we could make a separate PR for the lifecycle change, then I'll rebase this onto the new master.