qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migra


From: Eugenio Perez Martin
Subject: Re: [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration
Date: Wed, 9 Dec 2020 18:57:12 +0100

On Tue, Dec 8, 2020 at 8:21 AM Stefan Hajnoczi <stefanha@gmail.com> 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!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]