vdpa: move vhost reset after get vring base
authorEugenio Pérez <eperezma@redhat.com>
Fri, 3 Mar 2023 17:24:38 +0000 (18:24 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 7 Mar 2023 17:38:59 +0000 (12:38 -0500)
commitc3716f260bff1bd3586a0dc3477e1febdd3a3f35
treef09575bbd08cc70b0a4d6b25d009189a549d72e3
parent0bb302a9960a186fc488068d268dc373e6b70876
vdpa: move vhost reset after get vring base

The function vhost.c:vhost_dev_stop calls vhost operation
vhost_dev_start(false). In the case of vdpa it totally reset and wipes
the device, making the fetching of the vring base (virtqueue state) totally
useless.

The kernel backend does not use vhost_dev_start vhost op callback, but
vhost-user do. A patch to make vhost_user_dev_start more similar to vdpa
is desirable, but it can be added on top.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230303172445.1089785-8-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>
hw/virtio/vhost-vdpa.c
hw/virtio/vhost.c
include/hw/virtio/vhost-backend.h