mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
vdpa-dev: get iova range explicitly
In commita585fad26b("vdpa: request iova_range only once") we remove GET_IOVA_RANGE form vhost_vdpa_init, the generic vdpa device will start without iova_range populated, so the device won't work. Let's call GET_IOVA_RANGE ioctl explicitly. Fixes:a585fad26b("vdpa: request iova_range only once") Signed-off-by: Longpeng <longpeng2@huawei.com> Message-Id: <20221224114848.3062-2-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
f07ceffdf5
commit
c672f348cb
@@ -53,6 +53,7 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||
VhostVdpaDevice *v = VHOST_VDPA_DEVICE(vdev);
|
||||
struct vhost_vdpa_iova_range iova_range;
|
||||
uint16_t max_queue_size;
|
||||
struct vhost_virtqueue *vqs;
|
||||
int i, ret;
|
||||
@@ -108,6 +109,14 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp)
|
||||
v->dev.backend_features = 0;
|
||||
v->started = false;
|
||||
|
||||
ret = vhost_vdpa_get_iova_range(v->vhostfd, &iova_range);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "vhost-vdpa-device: get iova range failed: %s",
|
||||
strerror(-ret));
|
||||
goto free_vqs;
|
||||
}
|
||||
v->vdpa.iova_range = iova_range;
|
||||
|
||||
ret = vhost_dev_init(&v->dev, &v->vdpa, VHOST_BACKEND_TYPE_VDPA, 0, NULL);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "vhost-vdpa-device: vhost initialization failed: %s",
|
||||
|
||||
Reference in New Issue
Block a user