Commit 9be7780
authored
Refactor xapi-storage-script to use modules (#6191)
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` global variable, however, is populated
when `Query.query` is called, so create an alias in the `RuntimeMeta`
module so that it can be used in the storage function implementations.1 file changed
+329
-273
lines changed
0 commit comments