'Convert BDI to the old format for drivers that need it.'

def _block_device_info_to_legacy(self, block_device_info):

    if self.use_legacy_block_device_info:
        ephemerals = driver_block_device.legacy_block_devices(driver.block_device_info_get_ephemerals(block_device_info))
        mapping = driver_block_device.legacy_block_devices(driver.block_device_info_get_mapping(block_device_info))
        swap = block_device_info['swap']
        if swap:
            swap = swap.legacy()
        block_device_info.update({'ephemerals': ephemerals, 'swap': swap, 'block_device_mapping': mapping})
