Skip to content

Commit

Permalink
Refactor xapi-storage-script to use modules
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Dec 19, 2024
1 parent e861cb6 commit 25fcecf
Showing 1 changed file with 961 additions and 882 deletions.
Loading

0 comments on commit 25fcecf

Please sign in to comment.