vhost: move iova_tree set to vhost_svq_start
commit5fde952bbdd521c10fc018ee04f922a7dca5f663
authorEugenio Pérez <eperezma@redhat.com>
Thu, 15 Dec 2022 11:31:36 +0000 (15 12:31 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 21 Dec 2022 11:35:28 +0000 (21 06:35 -0500)
tree2b5bf8978efbf8e8f8c55b1ed57c29a80f8139e7
parent3cfb4d069cd2977b707fb519c455d7d416e1f4b0
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>
hw/virtio/vhost-shadow-virtqueue.c
hw/virtio/vhost-shadow-virtqueue.h
hw/virtio/vhost-vdpa.c