Skip to content

Commit 35948a7

Browse files
committed
Refactor xapi-storage-script to use modules
The `bind` function in xapi-storage-script has lots of implementaions all over the place, making it hard to maintain. Use module abstractions to separate different storage functions. The tricky bit of this is the need to pass `version` and `volume_script_dir` into each storage function calls, and these two variables are determined at runtime. Hence functors are used for this purpose, once the `volume_script_dir` is determined when `bind` is called, pass this as inside the `RuntimeMeta` module to the relevant implementations. The `version` ref cell is populated when `Query.query` is called, which should be the first call of each plugin. Once it is populated, it will then be used by different plugin functions. We do need a separate version for each plugin though, so create a new module (which contains a new version) each time bind is called, just as before. Signed-off-by: Vincent Liu <[email protected]>
1 parent 34b5b63 commit 35948a7

File tree

1 file changed

+959
-882
lines changed

1 file changed

+959
-882
lines changed

0 commit comments

Comments
 (0)