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>
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>
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>
Merge pull request #1497 from euanh/CA-113235

CA-113235: Don't call init.d scripts directly
Merge pull request #1495 from simonjbeaumont/cp-5970

CP-5970: Move xenops' cancellable watch paths
Merge pull request #1468 from siddharthv/clear-dns

XOP-435: Allow clearing of DNS entries.
Remove networkd from xen-api in favour of xcp-networkd

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Remove networkd from the spec file

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Use xcp-idl for network client

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Use xcp-idl for rrd interface, and remove rrdd

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
storage interface: plumb through SR.stat

Now a XenAPI SR.update will call SR.stat.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Plumb VDI.resize through the SMAPIv2

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Update storage_interface to latest and fix up fallout.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Use xcp-idl for storage interface rather than our own copy

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Switch to using xcp ocamlfind packages from xcp-idl

Conflicts:

	ocaml/OMakefile
	ocaml/network/OMakefile
	ocaml/network/network_interface.ml
	ocaml/rrdd/interface/OMakefile
	ocaml/sm-cli/OMakefile
	ocaml/test/OMakefile
	ocaml/xapi/OMakefile
	ocaml/xenops/memory_interface.ml
	ocaml/xenops/xenops_client.ml
	ocaml/xenops/xenops_interface.ml

Conflicts:
	ocaml/network/OMakefile
	ocaml/rrdd/OMakefile
	ocaml/rrdd/interface/OMakefile
	ocaml/test/OMakefile
	ocaml/xapi/OMakefile
	ocaml/xenops/OMakefile
	ocaml/xenops/memory_client.ml
	ocaml/xenops/memory_interface.ml
	ocaml/xenops/squeeze_xen.ml
	ocaml/xenops/squeezed.ml
	ocaml/xenops/xenops_client.ml
	ocaml/xenops/xenops_interface.ml
	ocaml/xenops/xenops_server.ml
	ocaml/xenops/xenops_server_xen.ml

Merged-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Fix the RPM build

Remove xenstore_watch library, remove redundant scripts, remove
redundant rpm packages, remove domain_sethandle

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Remove RPMS from XS build integration that are now built elsewhere

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