mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
vhost: move iova_tree set to vhost_svq_start
Since we don't know if we will use SVQ at qemu initialization, let's allocate iova_tree only if needed. To do so, accept it at SVQ start, not at initialization. This will avoid to create it if the device does not support SVQ. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20221215113144.322011-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
3cfb4d069c
commit
5fde952bbd
3 changed files with 8 additions and 11 deletions
|
@ -430,8 +430,7 @@ static int vhost_vdpa_init_svq(struct vhost_dev *hdev, struct vhost_vdpa *v,
|
|||
for (unsigned n = 0; n < hdev->nvqs; ++n) {
|
||||
VhostShadowVirtqueue *svq;
|
||||
|
||||
svq = vhost_svq_new(v->iova_tree, v->shadow_vq_ops,
|
||||
v->shadow_vq_ops_opaque);
|
||||
svq = vhost_svq_new(v->shadow_vq_ops, v->shadow_vq_ops_opaque);
|
||||
g_ptr_array_add(shadow_vqs, svq);
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1062,7 @@ static bool vhost_vdpa_svqs_start(struct vhost_dev *dev)
|
|||
goto err;
|
||||
}
|
||||
|
||||
vhost_svq_start(svq, dev->vdev, vq);
|
||||
vhost_svq_start(svq, dev->vdev, vq, v->iova_tree);
|
||||
ok = vhost_vdpa_svq_map_rings(dev, svq, &addr, &err);
|
||||
if (unlikely(!ok)) {
|
||||
goto err_map;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue