Check for BIOS strings on restart and update DB in case of mismatch.
CA-101922: Properly close the nbd connection

The recent change to default http connections to v1.1 and
keep-alive=true was probably the cause of failures in storage
migration. This patch reverts the connection in question to
the previous behaviour

It's likely what happened was that xapi kept the connection
open after the fd was handed off to tapdisk and consumed
the requests coming in from the source.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1692 from simonjbeaumont/ca-130038

[Dodger] CA-130038: Backport fix for NBD connection handling
Remove xiu

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
SCTX-1649: Set SO_KEEPALIVE on server sockets

This ensures that a TCP connection is cleaned up on the server, when
the connection is closed on the client without the server knowing (for
example, if a FIN packet is not sent or went missing).

This does not affect idle connections, or long-running
XenAPI calls.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-116551: Prevent xenguest from creating extra log files.
Signed-off-by: Akshay <akshay.ramani@citrix.com>
CA-129089: Disable global login via slave hosts

Signed-off-by: Zheng Li <dev@zheng.li>
CA-129192: restore metadata for all SR

CA-129192/SCTX-1728: revise restore-sr-metadata.py so that it could restore
metadata for all SR with command line:
   ./restore-sr-metadata.py -f <input file> -u all
or just omit the sr-uuid:
   ./restore-sr-metadata.py -f <input file>

xe-restore-metadata is modified accordingly.

Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
CA-146595: Improve parsing of VM platform flags

We need to be able to use 0 and 1 in (at least) the case of the acpi key.
Before this patch, using 0 and 1 would have both been converted to true when
passed to Xenopsd and therefore wrong arguments could be passed to Qemu when
trying to disable this feature.

This patch makes the 'bool' function a little more lenient on its input rather
than using OCaml's stock bool_of_string. It also introduces a warning message
if the value has been specified incorrectly.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Add a configurable idle timeout to stunnel

Imported from xen-api.git 53ef46d2491bad21366ffa63cadcc59adfbca34c

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

Conflicts:
	ocaml/xapi/xapi.ml
Add configurable idle timeout to stunnel

Imported from xcp-inventory.git 13735def832bff388e6d01c34645a4cef3fc73eb

Signed-off-by: Akshay <akshay.ramani@citrix.com>
Imported-by: John Else <john.else@citrix.com>
Merge pull request #1972 from ravippandey/SCTX-1645_tamlcm

[Lull/HFX-1255]SCTX-1649: Set SO_KEEPALIVE on server sockets
CA-92550: Update xenstore permissions on /vm/<uuid> tree to reflect the new domain ID when a domain is rebooted or migrated to localhost.

Signed-off-by: Euan Harris <euan.harris@citrix.com>
CA-135187: Filter out restricted device_config keys

A commit fixing SCTX-1616 now causes PBD create to throw an error if given
a device_config with the SRmaster key in (internal use only).

However, if this happened to exist from a time when this was not forbidden then
pool join will fail since the slave uses the device_config from the master's
PBD record which might contain this key.

This commit filters this key out in the pool join code-path.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
SCTX-1616: Ensure PBD.device_config:SRmaster never exists

This should never be part of the PBD record. Instead it is computed before each
SM call in (the internal function) Sm.__get_my_devconf_for_sr before being
passed to the SM driver. Having this field in the device config will mean that
the wrong value could be passed to the SM.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1981 from ravippandey/Lull/HFX-980

[Lull/HFX-980]CA-116551: Prevent xenguest from creating extra log files.
Merge pull request #1983 from ravippandey/Lull/HFX-1159

[Lull/HFX-1159] CA-129089: Disable global login via slave hosts
Merge pull request #1984 from ravippandey/Lull/HFX-1161

[Lull/HFX-1161]CA-129192: restore metadata for all SR
Merge pull request #1985 from ravippandey/Lull/HFX-1272

[Lull/HFX-1272]CA-146595: Improve parsing of VM platform flags
Merge pull request #1987 from sharady/Lull/HFX-1248

[Lull/HFX-1248] CA-92550: Update xenstore permissions on /vm/<uuid> tree to reflect the ...