xenopsd: Support driver domains for PV guests

The case of HVM guests with emulated QEMU networks devices is not yet
handled.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Allow setting the VIF backend for a network

If, on a network, other_config:backend_vm is set to the UUID of a VM, this VM is
used for the VIF backends (netback) of any VIFs on the network.

This is useful for internal networks (only), since the key is set on a network
rather than on a PIF.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Whitespace: xapi_vm.ml

$ camlp4o -printer o -no_comments ocaml/xapi/xapi_vm.ml | md5sum
46e5866dd5fcb2d8ebac427aa1889aad  -
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/xapi/xapi_vm.ml | md5sum
46e5866dd5fcb2d8ebac427aa1889aad  -

Signed-off-by: John Else <john.else@citrix.com>
CA-99726: Don't make VM.provisions wait in line

VM.provision will run after a template has been copied or cloned, so we
don't need it to wait in line behind other VM.copy or VM.checkpoint
tasks.

Signed-off-by: John Else <john.else@citrix.com>
CP-2190 for PR-1221: SR alerts for hosts can be configured on the SR now.

To reduce the effort of configuration, whereas previously it was
necessary to configure throughput alerts for an SR on each host
individually, now it is possible to set up a per-host SR throughput
alert for each host connected to an SR by writing to the SR's
other-config:perfmon key.
CP-4325: Split License_check.check_expiry up into two functions.

Signed-off-by: John Else <john.else@citrix.com>
CP-4325: Implement pool.get_license_state

Signed-off-by: John Else <john.else@citrix.com>
CP-4325: Add pool.license_state getter to CLI

Signed-off-by: John Else <john.else@citrix.com>
Add Test_common.make_pool

Signed-off-by: John Else <john.else@citrix.com>
Add high-level unit testing framework

Signed-off-by: John Else <john.else@citrix.com>
CP-4325: Add tests for pool-wide license logic

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

$ camlp4o -printer o -no_comments ocaml/xapi/create_misc.ml | md5sum
363fca0fe17fb3e89753b6aa62add69f  -
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/xapi/create_misc.ml | md5sum
363fca0fe17fb3e89753b6aa62add69f  -

Signed-off-by: John Else <john.else@citrix.com>
CP-4319: Add field host.cpu_info:socket_count

Signed-off-by: John Else <john.else@citrix.com>
CP-4319: Pass number of CPU sockets to v6d

Signed-off-by: John Else <john.else@citrix.com>
CP-4324: Implement pool.apply_edition

Signed-off-by: John Else <john.else@citrix.com>
CP-4324: Add pool.apply_edition to the CLI

Signed-off-by: John Else <john.else@citrix.com>
CP-4321: Host edition upgrade rules

Free and XenDesktop licenses are left as is.
Advanced, Enterprise and Platinum licenses are converted to per-socket
license.
Anything else is made into a free license.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1080 from johnelse/sku-flattening-xapi

CP-4102: xapi licensing changes
Merge pull request #1035 from johnelse/ca-99726

CA-99726: Don't make VM.provisions wait in line
CA-101788: increase xenconsoled default number of fds in xenservices from 1024 to 4096

xenconsoled is currently started in xenservices using the default ulimit -n
value 1024. This aligns well with the limit of 1024 fds that the xenconsoled
select() can handle. Each vm console will tipically use 3 fds (4 if logging
is enabled), limiting the number of consoles in dom0 to a couple of hundred.

The new upstream xenconsoled uses poll() instead of select() and can handle
>1024 fds, as long as its ulimit -n value is properly set up in xenservices.
Increasing this value to 4096 will allow us to have 1000 vm consoles in dom0,
which is more aligned to other values.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>