CA-134972: fix a tight loop getting xenops updates

Each barrier injected among the xenops events now holds a snapshot of
the event id counter as well as the set of events. The get function uses
this to select only the barriers newer than the "from" parameter, and
returns it as the "id of latest thing found" if it is newer than all the
events. If there are no barriers or events to return then the function
waits: this behaviour is unchanged, but now there will be no barriers to
return if there are barriers but they are all too old to be of interest
to the caller.

This means a client no longer keeps calling repeatedly with the same
"from" and getting back the same result (one or more barriers, no events
and the same next-id as the "from" param).

Because each barrier has an extra int associated with it, the formats
for RPC and Dump have changed in a backwards-incompatible way.

This is based on commit b68d6003 in the xs64bit-ring3 branch of the
xen-api repository.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Merge pull request #76 from thomassa/tr3-xenopsd-tightloop-CA-134972

CA-134972: fix a tight loop getting xenops updates
Remove redundant definition of updates

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Move generally useful event_wait code to lib

Fix a bug with the xenlight version while we're at it.

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Queue the VM.remove operation

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #77 from jonludlam/CA-134757

CA-134757
CA-137467: Revert "CP-5970: Move xenops' cancellable watch paths"

This reverts commit 62b69186e414b19c8a4fb69c1925bc287631eb9f.
CA-137467: Move get_private_path to shared location

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-137467: Move cancel paths into private XenStore tree

Move all of the xenopsd paths out of the paths used by the XenBus protocol
(/local/domain/<backend-domid>/<device-kind>/<frontend-domid>/...) and into the
already-existing private subtree it maintains.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Add back the internal events into xc backend

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Add internal updates back into xenlight backend

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
event_wait now takes a 'local_updates' param

This is so it can be used in the two different contexts required

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #79 from jonludlam/fix_bvt_blocker

Fix bvt blocker
CA-124378: Default acpi_s{3,4} to 0 in platformdata

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #78 from simonjbeaumont/xenops-paths

Move Xenops related data into private XenStore subtree
Merge pull request #80 from jonludlam/CA-124378

CA-124378: Default acpi_s{3,4} to 0 in platformdata
CA-136278: ensure '/local/domain/0/domid = 0'

This is needed for libxl functions to work. Without this expect strange
errors.

Signed-off-by: David Scott <dave.scott@citrix.com>
CA-136150: always create /var/run/xen (if it doesn't already exist)

libxl will fail to execute pygrub without this directory.

Signed-off-by: David Scott <dave.scott@citrix.com>
Merge pull request #81 from djs55/CA-136276

Make libxl happy
CA-138930: Xapi should not call domain_set_memmap_limit for HVM domains.

Since Xen 4.2 the hypercall behind xc_domain_set_memmap_limit() is not
permitted for HVM domains. Xapi should only call this for PV domains.

Signed-off-by: Akshay <akshay.ramani@citrix.com>