Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: rework example to expose pure KV #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Firobe
Copy link
Collaborator

@Firobe Firobe commented Sep 3, 2024

Hi!

This PR does two things:

  • pin notafs directly from the unikernel's config.ml so it doesn't need to be pinned manually (so that step is removed from the README)
  • introduce a notafs_kv_rw function in config.ml that takes a block implementation (and a few other parameters, see the doc) and returns a kv_rw implementation, so that notafs-kv can be a real drop-in replacement for unikernels that already expect a KV (say, from a tar file)

A few thoughts:

  • here, all that code is introduced in the example config.ml, but of course the goal would be to merge this code upstream in mirage. This can be a first draft towards that goal
  • I change the example, but we could very well duplicate it (since this doesn't prevent people to directly use Block and the library, as done initialy) if you prefer
  • we could have a notafs_kv_ro as well if needed
  • currently notafs_kv_rw takes a format parameter to determine if the block should be formatted always, never or the first time. This could very well be a proper configure-time or run-time parameter as well
  • the logic for connection could be slightly easier if Notafs.KV took the checksum implementation as its first argument instead of its second (we wouldn't need to define a type for checksums)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant