On Tue, Dec 8, 2020 at 8:21 AM Stefan Hajnoczi <stefanha@xxxxxxxxx> wrote: > > On Fri, Nov 20, 2020 at 07:50:46PM +0100, Eugenio Pérez wrote: > > @@ -1571,6 +1577,13 @@ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) > > BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); > > int i, r; > > > > + if (hdev->sw_lm_enabled) { > > + /* We've been called after migration is completed, so no need to > > + disable it again > > + */ > > + return; > > + } > > + > > for (i = 0; i < hdev->nvqs; ++i) { > > r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i, > > false); > > What is the purpose of this? It is again a quick hack to get shadow_vq POC working. Again, it deserves a better comment :). If I recall correctly, vhost-net calls vhost_dev_disable_notifiers again on destruction, and it calls to memory_region_del_eventfd, then virtio_pci_ioeventfd_assign, which is not safe to call again because of the i != mr->ioeventfd_nb assertion. The right fix for this should be either in virtio-pci (more generic, but not sure if calling it again is the expected semantic of it), individual vhost devices (less generic) or where it is at this moment, but with the right comment. Thanks!