I've been trying to tidy up the mirage block device interface before the big release. I've added a signature BLOCK to mirage-types:
and allows you to read and write from/to a set of buffers.
I've proposed a less-abstract version of the signature in mirage-platform/xen (but it should be common to both unix and xen):
+module type S = V1.BLOCK_DEVICE
+ with type page_aligned_buffer := Cstruct.t
+ and type 'a io := 'a Lwt.t
together with a lookup table mapping driver names (strings) to (module S) instances. Does this seem like a reasonable approach?
In my xen block driver I've added support for this interface and left the old code for backwards compat:
The idea is the block driver will automatically register itself as a driver called "local". A Unix version could do the same. We could add things like "iscsi" later.
Finally I've proposed some test cases for mirage-skeleton which check various read/write operations seem to be working (and failing when they should be failing etc):
Let me know what you think. The next step would be to get this new interface working on Unix and then to start working on a filesystem interface (for those who like that sort of thing)
Cheers,
--
Dave Scott