Skip to content

Commit

Permalink
Refactor xapi-storage-script to use modules (#6191)
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.
  • Loading branch information
Vincent-lau authored Jan 31, 2025
2 parents 6ca87f1 + 0b47e27 commit 9be7780
Showing 1 changed file with 329 additions and 273 deletions.
Loading

0 comments on commit 9be7780

Please # to comment.