Skip to contentSkip to conversation

virtio_vdpa: Support surprise removal of virtio vdpa device

PATCH Superseded dongsheng li 1 participant 1 message Jan 11, 2022 virtio core

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_vdpa: Support surprise removal of virtio vdpa device

When virtio vdpa device removed, the abnormal damage of the device cannot be perceived normally, which will cause problems similar to:

Commit 43bb40c5b926 ("virtio_pci: Support surprise removal of virtio pci device")

Hence, add the ability to abort the command on surprise removal

---
 drivers/virtio/virtio_vdpa.c | 1 +
 1 file changed, 1 insertion(+)
drivers/virtio/virtio_vdpa.c +1 -0
index 4a9ddb44b2a7..fd930409d190 100644
@@ -374,6 +374,7 @@ static void virtio_vdpa_remove(struct vdpa_device *vdpa)
 {
 	struct virtio_vdpa_device *vd_dev = vdpa_get_drvdata(vdpa);
 
+	virtio_break_device(vd_dev->vdev);
 	unregister_virtio_device(&vd_dev->vdev);
 }
 
Signature · 1 line
2.17.1