def _call_live_migrate_command(self, command_name, vm_ref, migrate_data):
        """unpack xapi specific parameters, and call a live migrate command."""
        # NOTE(coreywright): though a nullable object field, migrate_send_data
        # is required for XenAPI live migration commands
        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')
        # NOTE(coreywright): convert to xmlrpc marshallable type
        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)

        # Add destination SR refs for all of the VDIs that we created
        # as part of the pre migration callback
        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:
                # Source and destination SRs have the same UUID, so get the
                # reference for the local SR
                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 = {}
        options = {}
        self._session.call_xenapi(command_name, vm_ref,
                                  migrate_send_data, True,
                                  vdi_map, vif_map, options)
dataset/ETHPy150Open openstack/nova/nova/virt/xenapi/vmops.py/VMOps._call_live_migrate_command/original