'Checks if the block device mapping is valid.'

def _is_bdm_valid(self, block_device_mapping):

    valid_bus = (constants.DEFAULT_ADAPTER_TYPE, constants.ADAPTER_TYPE_BUSLOGIC, constants.ADAPTER_TYPE_IDE, constants.ADAPTER_TYPE_LSILOGICSAS, constants.ADAPTER_TYPE_PARAVIRTUAL)
    for disk in block_device_mapping:
        adapter_type = disk.get('disk_bus')
        if ((adapter_type is not None) and (adapter_type not in valid_bus)):
            raise exception.UnsupportedHardware(model=adapter_type, virt='vmware')
