def _live_migration(self, context, instance, dest, post_method, recover_method, block_migration=False, migrate_data=None):
    'Do live migration.\n\n        :param context: security context\n        :param instance:\n            nova.db.sqlalchemy.models.Instance object\n            instance object that is migrated.\n        :param dest: destination host\n        :param post_method:\n            post operation method.\n            expected nova.compute.manager._post_live_migration.\n        :param recover_method:\n            recovery method when any exception occurs.\n            expected nova.compute.manager._rollback_live_migration.\n        :param block_migration: if true, do block migration.\n        :param migrate_data: implementation specific params\n        '
    try:
        if block_migration:
            flaglist = CONF.libvirt.block_migration_flag.split(',')
        else:
            flaglist = CONF.libvirt.live_migration_flag.split(',')
        flagvals = [getattr(libvirt, x.strip()) for x in flaglist]
        logical_sum = reduce((lambda x, y: (x | y)), flagvals)
        dom = self._lookup_by_name(instance['name'])
        pre_live_migrate_data = (migrate_data or {}).get('pre_live_migration_result', {})
        listen_addrs = pre_live_migrate_data.get('graphics_listen_addrs')
        migratable_flag = getattr(libvirt, 'VIR_DOMAIN_XML_MIGRATABLE', None)
        if ((migratable_flag is None) or (listen_addrs is None)):
            self._check_graphics_addresses_can_live_migrate(listen_addrs)
            dom.migrateToURI((CONF.libvirt.live_migration_uri % dest), logical_sum, None, CONF.libvirt.live_migration_bandwidth)
        else:
            old_xml_str = dom.XMLDesc(migratable_flag)
            new_xml_str = self._correct_listen_addr(old_xml_str, listen_addrs)
            dom.migrateToURI2((CONF.libvirt.live_migration_uri % dest), None, new_xml_str, logical_sum, None, CONF.libvirt.live_migration_bandwidth)
    except Exception as e:
        with excutils.save_and_reraise_exception():
            LOG.error(_LE('Live Migration failure: %s'), e, instance=instance)
            recover_method(context, instance, dest, block_migration)
    timer = loopingcall.FixedIntervalLoopingCall(f=None)

    def wait_for_live_migration():
        'waiting for live migration completion.'
        try:
            self.get_info(instance)['state']
        except exception.InstanceNotFound:
            timer.stop()
            post_method(context, instance, dest, block_migration, migrate_data)
    timer.f = wait_for_live_migration
    timer.start(interval=0.5).wait()
Do live migration.

:param context: security context
:param instance:
    nova.db.sqlalchemy.models.Instance object
    instance object that is migrated.
:param dest: destination host
:param post_method:
    post operation method.
    expected nova.compute.manager._post_live_migration.
:param recover_method:
    recovery method when any exception occurs.
    expected nova.compute.manager._rollback_live_migration.
:param block_migration: if true, do block migration.
:param migrate_data: implementation specific params
def _live_migration(self, context, instance, dest, post_method, recover_method, block_migration=False, migrate_data=None):
    'Do live migration.\n\n        :param context: security context\n        :param instance:\n            nova.db.sqlalchemy.models.Instance object\n            instance object that is migrated.\n        :param dest: destination host\n        :param post_method:\n            post operation method.\n            expected nova.compute.manager._post_live_migration.\n        :param recover_method:\n            recovery method when any exception occurs.\n            expected nova.compute.manager._rollback_live_migration.\n        :param block_migration: if true, do block migration.\n        :param migrate_data: implementation specific params\n        '
    try:
        if block_migration:
            flaglist = CONF.libvirt.block_migration_flag.split(',')
        else:
            flaglist = CONF.libvirt.live_migration_flag.split(',')
        flagvals = [getattr(libvirt, x.strip()) for x in flaglist]
        logical_sum = reduce((lambda x, y: (x | y)), flagvals)
        dom = self._lookup_by_name(instance['name'])
        pre_live_migrate_data = (migrate_data or {}).get('pre_live_migration_result', {})
        listen_addrs = pre_live_migrate_data.get('graphics_listen_addrs')
        migratable_flag = getattr(libvirt, 'VIR_DOMAIN_XML_MIGRATABLE', None)
        if ((migratable_flag is None) or (listen_addrs is None)):
            self._check_graphics_addresses_can_live_migrate(listen_addrs)
            dom.migrateToURI((CONF.libvirt.live_migration_uri % dest), logical_sum, None, CONF.libvirt.live_migration_bandwidth)
        else:
            old_xml_str = dom.XMLDesc(migratable_flag)
            new_xml_str = self._correct_listen_addr(old_xml_str, listen_addrs)
            dom.migrateToURI2((CONF.libvirt.live_migration_uri % dest), None, new_xml_str, logical_sum, None, CONF.libvirt.live_migration_bandwidth)
    except Exception as e:
        with excutils.save_and_reraise_exception():
            LOG.error(_LE('Live Migration failure: %s'), e, instance=instance)
            recover_method(context, instance, dest, block_migration)
    timer = loopingcall.FixedIntervalLoopingCall(f=None)

    def wait_for_live_migration():
        'waiting for live migration completion.'
        try:
            self.get_info(instance)['state']
        except exception.InstanceNotFound:
            timer.stop()
            post_method(context, instance, dest, block_migration, migrate_data)
    timer.f = wait_for_live_migration
    timer.start(interval=0.5).wait()