'Preparations for live migration at dest host.
:param context: security context
:param instance: dict of instance data
:param block_migration: if true, prepare for block migration
:param migrate_data: A dict or LiveMigrateData object holding data
required for live migration without shared
storage.'

@wrap_exception()
@wrap_instance_event(prefix='compute')
@wrap_instance_fault
def pre_live_migration(self, context, instance, block_migration, disk, migrate_data):

    LOG.debug('pre_live_migration    data    is    %s', migrate_data)
    got_migrate_data_object = isinstance(migrate_data, migrate_data_obj.LiveMigrateData)
    if (not got_migrate_data_object):
        migrate_data = migrate_data_obj.LiveMigrateData.detect_implementation(migrate_data)
    block_device_info = self._get_instance_block_device_info(context, instance, refresh_conn_info=True)
    network_info = self.network_api.get_instance_nw_info(context, instance)
    self._notify_about_instance_usage(context, instance, 'live_migration.pre.start', network_info=network_info)
    migrate_data = self.driver.pre_live_migration(context, instance, block_device_info, network_info, disk, migrate_data)
    LOG.debug('driver    pre_live_migration    data    is    %s', migrate_data)
    self.network_api.setup_networks_on_host(context, instance, self.host)
    self.driver.ensure_filtering_rules_for_instance(instance, network_info)
    self._notify_about_instance_usage(context, instance, 'live_migration.pre.end', network_info=network_info)
    if ((not got_migrate_data_object) and migrate_data):
        migrate_data = migrate_data.to_legacy_dict(pre_migration_result=True)
        migrate_data = migrate_data['pre_live_migration_result']
    LOG.debug('pre_live_migration    result    data    is    %s', migrate_data)
    return migrate_data
