xenstore: add per-node generation counter
authorJuergen Gross <jgross@suse.com>
Mon, 5 Dec 2016 07:48:45 +0000 (08:48 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 5 Dec 2016 11:21:35 +0000 (11:21 +0000)
commit9e49dcf67f4aa3e318e618e51eeb547a117c3805
treeca04ed60b0eeb9cf74a7826bd993e8fc93a76901
parent2d41c050176bd9972d1c49c60a710e399045dc80
xenstore: add per-node generation counter

In order to be able to support reading the list of a node's children in
multiple chunks (needed for list sizes > 4096 bytes) without having to
allocate a temporary buffer we need some kind of generation counter for
each node. This will help to recognize a node has changed between
reading two chunks.

As removing a node and reintroducing it must result in different
generation counts each generation value has to be globally unique. This
can be ensured only by using a global 64 bit counter.

For handling of transactions there is already such a counter available,
it just has to be expanded to 64 bits and must be stored in each
modified node.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
tools/xenstore/include/xenstore_lib.h
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_transaction.c