libxl: ocaml: add some more builtin types.

  * bitmaps
  * string_list
  * key_value_list
  * cpuid_policy_list (left "empty" for now)

None of these are used yet, so no change to the generated code.

Bitmap_val requires a ctx, so leave it as an abort for now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add domain_build/create_info and events to the bindings.

We now have enoguh infrastructure in place to do this trivially.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxc: ocaml: Add simple binding for xentoollog (output only).

These bindings allow ocaml code to receive log message via xentoollog
but do not support injecting messages into xentoollog from ocaml.
Receiving log messages from libx{c,l} and forwarding them to ocaml is
the use case which is needed by the following patches.

Add a simple noddy test case (tools/ocaml/test).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: allocate a long lived libxl context.

Rather than allocating a new context for every libxl call begin to
switch to a model where a context is allocated by the caller and may
then be used for multiple calls down into the library.

As a starting point convert list_domains and send_debug_keys and
implement simple tests which use them. These are just PoC of the
infrastructure, I don't intend to add one for every function...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: switch all functions over to take a context.

Since the context has a logger we can get rid of the logger built into these
bindings and use the xentoollog bindings instead.

The gc is of limited use when most things are freed with libxl_FOO_dispose,
so get rid of that too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: propagate the libxl return error code in exceptions

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: generate libxl_domain_config bindings

With the infrastructure we now have in place this is trivial.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: idl: add domain_type field to libxl_dominfo struct

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: fix the META file

The "xl" module was renamed to "xenlight" some time ago, but the
META file was not updated.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: fix the handling of enums in the bindings generator

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: use the "string option" type for IDL strings

The libxl IDL is based on C type "char *", and therefore "strings" can
by NULL, or be an actual string. In ocaml, it is common to encode such
things as option types.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add META to list of generated files in Makefile

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add with_ctx helper function

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add xen_console_read

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add dominfo_list

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add dominfo_get

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add NIC helper functions

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: add wrappers for poll

We need this in order to wrap the event API of libxl.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: event management

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
libxl: ocaml: allow device operations to be called asynchronously

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>