Update to the Xen-4.2 interface (deactived by #ifdefs)

We now have:
 * configurable xenstore and console backend domids
 * incrementable VM generation counts

This is all disabled by #ifdef XENGUEST_4_2 for now.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
If Xenctrl.domain_set_mmap_limit fails, log and continue

For an undiagnosed reason, this fails on xen-4.2

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
CA-89978: Fix restoration of database from temporary restore file.

- Delete the temporary restore file after using it to populate the
  database - if we don't do this then xapi will use the restore file
  again the next time it starts up.

- Perform the initial database flush to the global list of database
  connections in all cases; don't flush to the restore database file
  if it's being used.

Signed-off-by: John Else <john.else@citrix.com>
CA-89978: Log the location(s) from which we're attempting to read the db.

Signed-off-by: John Else <john.else@citrix.com>
CP-3638: Remove now redundant code from various source files in rrdd and xapi.

Signed-off-by: Rok Strniša <rok.strnisa@citrix.com>
CA-87758: When handling an HTTP request, perform any logins/logouts on the master.

Previously we always attempted all logins and logouts via an RPC call
to localhost - the logouts would fail silently on a slave, causing a
session leak.

Signed-off-by: John Else <john.else@citrix.com>
CA-90580: Pass VIF QoS settings to xenopsd.

Previously we were just passing rate = None, independent of the QoS
settings in xapi.

Signed-off-by: John Else <john.else@citrix.com>
CA-84305: Allow SR.destroy if an SR contains only unmanaged VDIs.

This was originally fixed as CA-79059, but the fix was lost when the
SR.allowed_operations code was moved to xapi_sr_operations.ml.

Signed-off-by: John Else <john.else@citrix.com>
Remove duplicated SR allowed_operations code.

As of the last commit, the removed code is identical to that in
xapi_sr_operations.ml.

Signed-off-by: John Else <john.else@citrix.com>
Whitespace: Xapi.resynchronise_ha_state

$ camlp4o -printer o -no_comments ocaml/xapi/xapi.ml | md5sum
27b3994fa590f6385c1c92568f8eb296  -
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/xapi/xapi.ml | md5sum
27b3994fa590f6385c1c92568f8eb296  -

Signed-off-by: John Else <john.else@citrix.com>
CA-88864: Make sure that dom0 is marked as running when resynchronising HA state.

Signed-off-by: John Else <john.else@citrix.com>
CA-77465 fix: xe pool-certificate-install now works with a filepath.
Also fixed the same bug in pool-crl-install.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
[new] New ocaml lib 'rrd-client' in order to move rrd2csv and RRDD plugins out of the xen-api repository
[fix] Fixing rrd-client compilation (a var was forgotten while merging)
[build] Adding RPM packaging information for the rrd-client library
Install xapi-rrd-devel package into PACKAGES.main as well.

RRD plugin framework should be installed by default for post-Tampa releases.

Signed-off-by: Rok Strniša <rok.strnisa@citrix.com>
CA-74343: Fix HA on VLANs

The recent change to not automatically plug VLANs on host boot (for
scalability reasons), led the HA code to believe that VMs on VLANs
were not agile, even if they were.

It turns out that the agility check for networking is too strict.
Currently, xapi only considers a VM agile if all its networks
1. have PIFs on all enabled hosts, AND
2. have all those PIFs attached/plugged.

This is too strict, because a PIF can always be plugged, unless it is
a bond slave, and xapi automatically plugs a PIF when it is needed by a
VM.

Therefore, the agility check was changed to require that a VM's networks
1. have PIFs on all enabled hosts, AND
2. none of those PIFs are bond slaves.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #865 from robhoes/master
Avoid cleaning too much

main build system write some file to main output directory.
Here OUTPUT_SDK_DIR point to the main directory so every files is
wiped out. OUTPUT_SDK_DIR is used only for tmp subdirectory so
clean only this directory
Create directory before copying files

There are cases where the site-packages directory is not created so install
will fail. Make sure directory exists before installing.