@@ -1263,6 +1263,18 @@ err:
return false;
}
+static void vhost_vdpa_svq_stop(struct vhost_dev *dev, unsigned idx)
+{
+ struct vhost_vdpa *v = dev->opaque;
+ VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, idx);
+
+ vhost_svq_stop(svq);
+ vhost_vdpa_svq_unmap_rings(dev, svq);
+
+ event_notifier_cleanup(&svq->hdev_kick);
+ event_notifier_cleanup(&svq->hdev_call);
+}
+
static void vhost_vdpa_svqs_stop(struct vhost_dev *dev)
{
struct vhost_vdpa *v = dev->opaque;
@@ -1272,13 +1284,7 @@ static void vhost_vdpa_svqs_stop(struct vhost_dev *dev)
}
for (unsigned i = 0; i < v->shadow_vqs->len; ++i) {
- VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, i);
-
- vhost_svq_stop(svq);
- vhost_vdpa_svq_unmap_rings(dev, svq);
-
- event_notifier_cleanup(&svq->hdev_kick);
- event_notifier_cleanup(&svq->hdev_call);
+ vhost_vdpa_svq_stop(dev, i);
}
}
To split each SVQ stop in its own stop routine let's us to reset a VQ individually, and to keep future vhost_vdpa_reset_queue symmetrical with vhost_vdpa_reset_queue. Signed-off-by: Eugenio PĂ©rez <eperezma@redhat.com> --- hw/virtio/vhost-vdpa.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)