CA-94406: VDI reset only on epoch begin

This resolves a bug where VDIs were reset after migration, because the act of
plugging a VBD will reset the VDI. A corresponding change in the storage
managers moves the reset_leaf call (which resets VDIs) to the SR command
"vdi_epoch_begin", which was recently added to Xapi's SMAPIv2.

This commit just adds the plumbing necessary to call epoch_begin and epoch_end
on VDIs in the storage layer. The corresponding commit in sm.hg adds those
commands to the storage layer, and also moves the reset_leaf call into
vdi_epoch_begin.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Remove erroneous extra call to VDI.epoch_end

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Functorise the client module so it can be used with Lwt

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Fix jsonrpc so that it marshalls the reponse in json rather than xml

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Scripts to fix the broken commits in this repo

The result of this can be pushed to github and passes a "git fsck"
SCTX-1228: VDB.unpluggable must be restored from the DB.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Merge pull request #960 from djs55/fix-broken-repo

Scripts to fix the broken commits in this repo
Merge pull request #958 from jonludlam/lwt-client-new

Lwt client new
CA-97023: Preserve VM settings (Optimized for Citrix XenApp)
CA-94335: Dom0 must not change memory-dynamic-(min|max) anymore.

Since Dom0 is no more memory ballooned.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
CA-94335: Dynamic-min and max have the same value as memory-target in Dom0.

Since Dom0 is no more ballooned.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Merge pull request #966 from jeromemaloberti/CA-94335

CA-94335: Dynamic-(min|max) in Dom0 have the same value as memory-target
Merge pull request #965 from siddharthv/CA-97023

CA-97023: Preserve VM settings (Optimized for Citrix XenApp)
Merge pull request #961 from jeromemaloberti/SCTX-1228

SCTX-1228: VDB.unpluggable must be restored from the DB.
Reduce verbosity of CLI command logging.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #967 from johnelse/cli-logging-change

Reduce verbosity of CLI command logging.
CA-96872: Fix marshalling of exceptions

Api_errors are of type string * string list, but they are actually
marshalled as just a string list

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #968 from jonludlam/CA-96872

CA-96872: Fix marshalling of exceptions
CA-97270: Now fix unmarshalling of exceptions...

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #970 from jonludlam/CA-97270

CA-97270: Now fix unmarshalling of exceptions...