Add a get_root_bdm utility function

Getting the root block device out of a list of block devices is a common
idiom and we use it in several places in our code base. This patch
factors it out in a handy utilty method and adds tests for it.

Change-Id: I4a2cb3c689fed9fbc0bc51ddba095e1269cacb2d
blueprint: clean-up-legacy-block-device-mapping
Move is_volume_backed_instance to new style BDM

Compute API is_volume_backed_instance used to rely on matching the
device name to the root_device_name field of the instance which had
several problems and edge cases.

Now that we have moved to the new BDM format that has the boot_index
and destination_type field for each block device - it is pretty
staightforward to implement.

Change-Id: Ia2c235f8bce577ed4ac6a480a4a051d159a5fad7
blueprint: clean-up-legacy-block-device-mapping
Remove unnecessary "LOG.error()" statement

Removes apparent debug statement left in from
Ifd41886b9bc7dff01cdf741a833946bed1bdddc

Fixes-Bug: #1239603
Change-Id: I9c5b9a6b2349a6c62bef2974ab3b0bb986533741
Merge "Remove unnecessary "LOG.error()" statement"
Merge "Add a get_root_bdm utility function"
Merge "Move is_volume_backed_instance to new style BDM"
xenapi: post install scriptlet to rpm

A freshly installed XenServer requires some modifications in order to be
able to run OpenStack. Nova contains an rpm specification to create a
package with the dom0 plugins, however installing the rpm is not enough.
Some more actions need to be taken:
 - create /images, link to a directory within the local SR
 - setup an ssh keypair, and authenticate it with the host
This change adds a post script to the nova plugins rpm spec file, so
by installing the rpm on a XenServer, it is ready to run OpenStack, no
further manual actions needed.

Change-Id: Id57e3a3ab2782550468c6aa4c01059ceb7cc81ab