xenstored: add the concept of an overlay filesystem

Currently we overlay all of our synthetic filesystems over the
persistent store, but we really ought to stack them over each
other first.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
xenstored: add Mount.Tree which provides an overlay view

This means the layer below the 'mount' will 'shine through'.
We can use this to combine together persistent data (such as
the domain domid,mfn,port) and transient data (such as stats
counters).

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
xenstored: correct the conditions under which 'rm' should fail

'rm foo' should fail if 'parent foo' doesn't exist
'rm foo' should succeed silently if 'parent foo' exists but 'foo'
  does not exist

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
xenstored: persist interdomain ring information in the store

When the toolstack sends us 'IntroduceDomain', we persist this
information before replying. When the interdomain transport is
destroyed, we forget this information. When we restart, we automatically
reconnect to all rings whose information we've persisted.

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

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
xenstored: store watch events in a persistent queue

This is needed to avoid dropping watch events over a restart.

Note: the queue API is within Lwt.t.

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

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

This doesn't work because each transaction needs to have a separate
persistent queue, and they need to be merged.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
PQueue.clear: if the node doesn't exist in the store then don't fail

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
test: clear any persisted watches between 'connections'

In a real server the flusher thread should transmit the watch events
and clear the queue. In the simulation, we clear the queue on 'connect'
since we don't actually have a flusher thread.

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

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Add more 'with sexp' for easier debug

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
test: make -verbose even more verbose than before

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
test: clear up some leftover state between tests

This is a problem because some of our configuration is in global
hashtables which aren't being cleared. Once it has all been put
in the store itself, blanking the store will do the right thing
and we can revert this patch.

The unit tests now pass again.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #27 from djs55/irminsule

Store watch events in a persistent queue