CA-106403: A timed out connection on writedb must be closed too.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
CA-106403: The DB should be locked before being flushed on redo_log.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
CA-106403: Fix pool-sync-database in case of failure with redo_logs.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
CA-111029: Switch to the C xenguest.
Allow xe vm-snapshot be run with multiple vms.

xe help vm-snapshot documents that this is how the command should
behave. Looking back through the `blame' of this line doesn't seem to
indicate any reason to disallow this.
Replace hard-coded mail-alarm sender with a user-setable value.

Without this patch, email from the pool are sent from
noreply@${FSQN}. Some organisations setup their email so as to only
allow emails from  whitelist of addresses, so are unable to get mail
alerts.

This patch lets the administrator run:
xe pool-param-set other-config:mail-sender=${SENDER}
to choose an whitelisted address.
Add missing () to call to getfqdn in mail-alarm
Correct /sys path for iovirt plugin.
Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Merge commit '69cb32b81cbe94ab22cf917dab489f832e469f10'
Enable -bin-annot compiler flag

This enables binary annotation for use with tools such as ocamlspotter.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-113392: Fix PBD password-secret lifecycle

When creating an SR, if there are any secrets in the device-config then they
are duplicated and a unique one is used for each PBD creation.

However, XenCenter's "Repair SR" feature creates new PBDs directly, copying the
device-config field from existing ones. This bypasses the secret-duplication
which is in the SR-create code path.

This patch pushes the secret-duplication logic down to the PBD creation which
solves the XenCenter issue pending a revised design of the secret datamodel.
Also the master is no-longer special cased for the same reason. This has the
added benefit of making secret creation/destruction entirely symmetrical: the
secrets created with PBDs are destroyed when the PBD is destroyed and the
secrets created manually must be destroyed manually.

XenCenter should now be updated to tidy up after itself: if it chooses to
create secrets around passwords used in SR creation, then they should be
destroyed in a finally block after the SR creation is complete. This is safe
since all PBDs will have duplicated the secret.

Note this patch applies (as the previous semantics did) to any key in device
config ending in '_secret'. The ones used by the SM backends are
'password_secret' and 'chappassword_secret'.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-115293: Revert "CA-109854: Don't include memory overhead when creating a VM."

Not including the overhead means we don't include it in the squeezed
reservation - therefore if

(maxmem < host free mem)

and

((maxmem + overhead) > host free mem)

we end up relying on xenguest to complain that we're out of memory.

This reverts commit b634e38590568e1f5b9b00080193b2d8aa870c1e.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1491 from johnelse/ca-115293

Revert "CA-109854: Don't include memory overhead when creating a VM"
CA-110973: Use more efficient db backup when on the pool master

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CP-5970: Move xenops' cancellable watch paths

Having these paths created were interferring with devices since they were being
recreated once the device had beeen destroyed in the case of VBDs. Now we'll
keep track of the cancellable watch paths in a separate subtree of XenStore and
also tie them to their Xenops task IDs to aid debugging. Also, the semantics of
how to cancel the task have been added (removing the key).

Old path: /local/domain/0/backend/vbd/<domid>/<devid>/tools/xenops/cancel

New path: /xenops/task/<task-id>/remove-to-cancel

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Move /xapi/* -> /xenops/* in XenStore

It's really xenops that's using these paths so it makes sense that these paths
be under that name.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1489 from jonludlam/CA-110973

Use more efficient db backup when on the pool master
Merge pull request #1487 from simonjbeaumont/ca-113392

CA-113392: Fix PBD password-secret lifecycle
CA-113235: Don't call init.d scripts directly

Some daemons are launched invoking /etc/init.d scripts directly. This
could be a problem in environment with upstart which wants to know the
status of these services. For this reason it's better to use the {service}
command to notify upstart.

Signed-off-by: Euan Harris <euan.harris@citrix.com>
XOP-435: Allow clearing of DNS entries.
Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>