Strip whitespace when reading RRD XML

Imported from xen-api.git f35f24e8dd7bf54a2db6b788316335b8c8111b82

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Imported-by: John Else <john.else@citrix.com>
rrdd: improve logging of metrics-parsing errors

Imported from xen-api.git 7306dd155f8cbebf148acdab5650f22cdf862e5a

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Imported-by: John Else <john.else@citrix.com>
CA-104483: rrdd: ensure plugins' checksums change

Previously, rrdd only checked whether the plugin's checksum is different
from the first one it saw for that plugin. This had the effect that, if
the checksum changed at least once since rrdd was started, the data was
always deemed to be fresh. The logic was flawed: Hashtbl.replace was only
called when the entry wasn't previously in the hashtable.

Instead, this patch checks the current checksum against the most recently
seen one. The effect of this is that data is only deemed fresh if it has
been updated recently.

Imported from xen-api.git a4a3e983bb9cff75a1fd504c677eb8db28ad9979

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Imported-by: John Else <john.else@citrix.com>
CA-106868: Datasource-list latency units are microseconds, not milliseconds

Imported from xen-api.git d739436f43aa923c29c73f2cc4edf9538e06590b

Signed-off-by: Akshay Ramani <akshay.ramani@citrix.com>
Imported-by: John Else <john.else@citrix.com>
XOP-369: Make RRDD plugins' data sources default=false

Imported from xen-api.git 23fd9026372c20a8ff9042d2ebcaa1fd7a67af63

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Imported-by: John Else <john.else@citrix.com>
XOP-369: Add a config parameter to set the 'default' for plugins' DSs

data sources provided by plugins currently are assumed to be
default=false. To change this, add a line to the config file, which
is found at /etc/xcp-rrdd.conf:

'plugin-default = true'

Imported from xen-api.git 405c6b21fc372ccda377f005bf2247cb8a8db653

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Imported-by: John Else <john.else@citrix.com>
Remove xenctrlext dependency

The required code is now in xenctrl.

Signed-off-by: John Else <john.else@citrix.com>
CA-101580: rrdd: watch xenstore instead of polling

xcp-rrdd is interested in domains' data/meminfo_free values.
In one example, polling xenstore for these values took about
30 seconds for 700 VMs. Instead of polling, use watches.

Imported from xen-api.git dc787f75ee153c3d0690540b155c9e2badf78163

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Imported-by: John Else <john.else@citrix.com>
Use separate xenstore clients for watching and reading

The xenstore client deadlocks if used to read from within a watch callback.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1 from johnelse/cp-5129

CP-5129: Bring xcp-rrdd functionally up to date with xen-api.git/master