vdpa: use VhostVDPAShared in vdpa_dma_map and unmap

The callers only have the shared information by the end of this series.
Start converting this functions.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20231221174322.3130442-12-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Eugenio Pérez
2023-12-21 18:43:20 +01:00
committed by Michael S. Tsirkin
parent 3c6d12a3b1
commit 6f03d9ef8a
3 changed files with 30 additions and 29 deletions

View File

@ -471,7 +471,8 @@ static void vhost_vdpa_cvq_unmap_buf(struct vhost_vdpa *v, void *addr)
return;
}
r = vhost_vdpa_dma_unmap(v, v->address_space_id, map->iova, map->size + 1);
r = vhost_vdpa_dma_unmap(v->shared, v->address_space_id, map->iova,
map->size + 1);
if (unlikely(r != 0)) {
error_report("Device cannot unmap: %s(%d)", g_strerror(r), r);
}
@ -495,7 +496,7 @@ static int vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v, void *buf, size_t size,
return r;
}
r = vhost_vdpa_dma_map(v, v->address_space_id, map.iova,
r = vhost_vdpa_dma_map(v->shared, v->address_space_id, map.iova,
vhost_vdpa_net_cvq_cmd_page_len(), buf, !write);
if (unlikely(r < 0)) {
goto dma_map_err;