CA-89884: vdi-introduce failed on slave

Partial application makes a function call always succeed (prematurely).

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Move some generic code into mock.ml

Signed-off-by: John Else <john.else@citrix.com>
Fix typo.

Signed-off-by: John Else <john.else@citrix.com>
Split the unit testing code up into separate modules.

Signed-off-by: John Else <john.else@citrix.com>
Create base unit test suite.

Signed-off-by: John Else <john.else@citrix.com>
Use a fresh Db_ref when creating a new mock database.

Signed-off-by: John Else <john.else@citrix.com>
Add a helper function to create a context with a fresh database.

Signed-off-by: John Else <john.else@citrix.com>
Move existing unit tests over to the OUnit suite.

Signed-off-by: John Else <john.else@citrix.com>
Turn on verbose unit test output.

Signed-off-by: John Else <john.else@citrix.com>
Update .gitignore.

Signed-off-by: John Else <john.else@citrix.com>
Hook existing unit tests up to OUnit.

Signed-off-by: John Else <john.else@citrix.com>
Rename unit test files.

Signed-off-by: John Else <john.else@citrix.com>
CA-94829: Set the TCP timeout properties on the migration fd

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-94160: Use allowed_operations system to block/allow VDI.forget.

We now block HA statefile and redo_log VDIs from being forgotten while
HA is enabled.

Forgetting VDIs with plugged VBDs is already blocked, but this patch
also adds forget to VDI.allowed_operations if it is allowed.

Signed-off-by: John Else <john.else@citrix.com>
CA-97883: Wrap the fstat call in an exception handler

We can get an exception when we're fstatting a file that's larger
than is representable in a signed 32-bit integer (ie., 2 gigs).
If this happens, it's clearly not a socket, so don't bother setting
the TCP timeout parameters.

This patch is actually a bit more defensive, and ignores any
exception thrown here.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_main.ml
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>
CA-97354: Preserve VM.snapshot_info across export/import and cross-pool migration.

Signed-off-by: John Else <john.else@citrix.com>
Add Tampa to historical release schemas.

Signed-off-by: John Else <john.else@citrix.com>
CP-3657: Update alert priorities

* Reversed the meaning of mail-min-priority config key, and renamed it
mail-max-priority.

* Removed priority checking from Xapi_vmpp.

* Updated priority checking in mail-alarm.