vhost-vdpa: make notifiers _init()/_uninit() symmetric
authorLaurent Vivier <lvivier@redhat.com>
Fri, 11 Feb 2022 16:13:09 +0000 (17:13 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 6 Mar 2022 10:08:23 +0000 (05:08 -0500)
commitb1f030a0a2e281193b09350c0281c0084e84bcf4
tree6c2b4ac80ef6f31156852913ec56643965afdaa6
parent98f7607ecda00dea3cbb2ed7b4427c96846efb83
vhost-vdpa: make notifiers _init()/_uninit() symmetric

vhost_vdpa_host_notifiers_init() initializes queue notifiers
for queues "dev->vq_index" to queue "dev->vq_index + dev->nvqs",
whereas vhost_vdpa_host_notifiers_uninit() uninitializes the
same notifiers for queue "0" to queue "dev->nvqs".

This asymmetry seems buggy, fix that by using dev->vq_index
as the base for both.

Fixes: d0416d487bd5 ("vhost-vdpa: map virtqueue notification area if possible")
Cc: jasowang@redhat.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220211161309.1385839-1-lvivier@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-vdpa.c