Add opam file

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Add backtrace design document

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Register an exception printer for API_ERROR

This means that Printexc.to_string will print the full parameter list
rather than just '_'.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Remove the exnhook: it's gone

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Use new Debug.with_thread_named API

This replaces the leak-friendly 'name_thread' function.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
The generated OCaml code should use Backtrace.reraise

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Update to new Backtrace manipulation APIs

- call Backtrace.is_important in exception handlers to prevent
  accidentally forgetting where we came from
- avoid calling log_exception all over the place -- we want single
  backtraces not lots of fragments
- update taskHelper.failed to take the exception, so it can later
  fetch the backtrace and process it.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Xenops: unmarshal the backtrace from failed Tasks and rethrow

This allows xenopsd backtraces to be joined up with xapi backtraces.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
XenAPI: Add Task.backtrace, and populate it when a task is failed

The field will contain an s-expression encoded Backtrace.t value. It
should be considered an opaque value.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
xe: support a '--trace' option

If '--trace' is provided then, if a failure occurs, a backtrace will be
fetched from the Task and printed.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #1999 from djs55/add-backtraces

Support reliable, cross-host, cross-process backtraces