'unpack xapi specific parameters, and call a live migrate command.'

def _call_live_migrate_command(self, command_name, vm_ref, migrate_data):

    migrate_send_data = None
    if ('migrate_send_data' in migrate_data):
        migrate_send_data = migrate_data.migrate_send_data
    if (not migrate_send_data):
        raise exception.InvalidParameterValue('XenAPI    requires    destination    migration    data')
    migrate_send_data = dict(migrate_send_data)
    destination_sr_ref = migrate_data.destination_sr_ref
    vdi_map = self._generate_vdi_map(destination_sr_ref, vm_ref)
    sr_uuid_map = None
    if ('sr_uuid_map' in migrate_data):
        sr_uuid_map = migrate_data.sr_uuid_map
    if sr_uuid_map:
        for sr_uuid in sr_uuid_map:
            sr_ref = self._session.call_xenapi('SR.get_by_uuid', sr_uuid)
            vdi_map.update(self._generate_vdi_map(sr_uuid_map[sr_uuid], vm_ref, sr_ref))
    vif_map = {}
    vif_uuid_map = None
    if ('vif_uuid_map' in migrate_data):
        vif_uuid_map = migrate_data.vif_uuid_map
    if vif_uuid_map:
        vif_map = self._generate_vif_network_map(vm_ref, vif_uuid_map)
        LOG.debug('Generated    vif_map    for    live    migration:    %s', vif_map)
    options = {}
    self._session.call_xenapi(command_name, vm_ref, migrate_send_data, True, vdi_map, vif_map, options)
