xapi-project/xen-api — pull request #1784 by thomassa (2014-06-06 11:02:36+00:00)
Title: 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 commit also changes two counters to start at min_int rather than 0,
and adds just a little debug-logging.