Add a stub 'persist' function to persist side-effects

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
side-effects: store as a single list of operations

A transaction may contain multiple operations on the same
path (rm /foo; mkdir /roo; rm /foo) hence ordering is
important.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Incremental commit: persist via irminsule

NB: this has broken the unit test somehow. When I turn off
persistence it works again.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Incremental commit

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Remove hand-written prettyprinters, replace with Sexplib

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Use a more common form of error type with [`Ok of 'a|`Error of 'b]

This is compatible with a number of other libraries, including
Mirage-based ones.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Rename 'to_string' and 'print' to 'marshal'; 'of_string' to 'unmarshal'

This is to make the meaning clear and to prepare for removing strings
from the marshalling/unmarshalling code.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Replace hand-written Store dump with Sexplib

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Replace an option with a result type.

We want all unmarshalling code to return a debuggable error rather
than simply 'None'.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Remove dead code

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
The incremental packet parser now uses result, and a Done | Continue variant

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Incremental commit: rationalise the marshalling and unmarshalling

The unit tests currently don't build. Quite a lot of fixups still
required.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Incremental commit: fix unit test

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
High-level store tests now build again

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
binary test now compiles

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Final incremental commit

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
quirk: when unmarshalling Getdomainpath, assume "" means domid 0
test: don't call ACL.unmarshal on a buffer with trailing junk

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Rename 'pair' to 'cons' since we actually want to pattern match on a list

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
core_test: improve printing on failure

Signed-off-by: David Scott <dave.scott@eu.citrix.com>