CP-6172: Add VBD.other_config:backend-kind

Note: this change is co-dependent on a change in xenopsd.

Blktap3 and kernel blkback need to co-exist and, since kernel blkback watches
keys in the /local/domain/0/vbd/ tree, the paths for blktap3 need to be moved.

A new key has been added to the other_config field of the VBD record which is
passed through to xenopsd to determine where to place the VBD's XenStore
entries.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-6172: Don't specify VBD backend-kind by default

Rather than defaulting this value (meaning we have to keep parity with
xenopsd), leave the default to be determined by xenopsd itself by not
specifying a backend-kind.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-6172: Xenopsd support for Blktap3

This allows Blktap2 and Blktap3 to coexist.

Note: the backend path is specified by a new "backend-kind" key in the
extra_backend_keys of the VBD metadata.

The default_vbd_backend_kind is configurable option and can be specified by
setting default-vbd-backend-kind in xenopsd.conf.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-6172: Refactor blktap3 support for backport

The work for Xenopsd to support multiple VBD backends was developed upstream in
xenopsd.git (post disaggregation) and was then squashed and ported wholesale in
478563a.

There are a number of differences in this pre-disaggregation world and this
commit adds the changes necessary for the backport to work:

    * Some fixes for the `xenops` binary to ignore the Vbd variant type
    * Move the parsed config away from xenopsd.ml to avoid circular dependency

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-6172: Enable blktap3 as default VBD backend kind

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-131057: Use list_frontends to get frontend device

This is how 'upstream' xenopsd.git gets a frontend in this function. Now we
support multiple backends for VBD, using list_devices is too naive and doesn't
construct the right device type for shutdown for example.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-119317: Move backend-kind to VDI.other_config

This way the SM driver can set this and special case where necessary for
certain SR types.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-119317: Consider VDI.sm_config:backend-kind

Allow a way of an SM driver to configure the VBD backend to be used for this
VDI. This is done by setting the backend-kind key in the sm_config field.

This value will be used but will still be overridden if a value appears in
other-config (user-configurable).

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Whitespace: Fix formatting in Xapi_vbd module.

The following produces the same before and after the commit.

    $ camlp4o -printer o -no_comments ocaml/xapi/xapi_vbd.ml | md5sum
    4d75d489ebdf8bb7b186baaba12a35bb  -

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-133780: Set VBD backend-kind on VBD creation

Getting this informaton from the VDI record in the Xenopsd metadata translation
layer caused CD-eject to hang because ejection is done by setting the VDI ref
for the VBD to NULL.

Instead, the SM can still set the backend-kind sm-config key which will be
placed in other-config of the VBD at creation. It can still be overwritten by
the user.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge commit '1218949154ef27ad71e4e6a617287481a05a72e8'
Merge remote-tracking branch 'hg/master' into xs64bit-blktap3
Use default VBD backend for empty CD drives

Now that the VDI is queried for a VBD backend at VBD creation, we need to
handle the case when the VBD is created with VDI ref NULL. This will be the
case for creating an empty CD drive, for example, on VM.import.

Since the model is to not add anything to the other_config field for default
behaviour then now we widen the exception handling such that _any_ failure to
find a specified backend kind results in the default.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge creedence into xs64bit-blktap3
Merge branch 'master' of git://hg.uk.xensource.com/carbon/creedence-blktap3/xen-api
Merge commit '5fc20e7168f449a77c941be6b60e973e1b518d13'
Merge remote-tracking branch 'creedence/master'

Merging blktap3 changes from creedence.