On Tue, 23 Jun 2020 12:01:25 +0100 "Dr. David Alan Gilbert" <dgilb...@redhat.com> wrote:
> * Cornelia Huck (coh...@redhat.com) wrote: > > On Sun, 21 Jun 2020 01:51:21 +0530 > > Kirti Wankhede <kwankh...@nvidia.com> wrote: > > > > > Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking > > > for VFIO devices. > > > > > > Signed-off-by: Kirti Wankhede <kwankh...@nvidia.com> > > > Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > > > --- > > > hw/vfio/migration.c | 36 ++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 36 insertions(+) > > > > > > diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c > > > index faacea5327cb..e0fbb3a01855 100644 > > > --- a/hw/vfio/migration.c > > > +++ b/hw/vfio/migration.c > > > @@ -11,6 +11,7 @@ > > > #include "qemu/main-loop.h" > > > #include "qemu/cutils.h" > > > #include <linux/vfio.h> > > > +#include <sys/ioctl.h> > > > > > > #include "sysemu/runstate.h" > > > #include "hw/vfio/vfio-common.h" > > > @@ -329,6 +330,32 @@ static int vfio_load_device_config_state(QEMUFile > > > *f, void *opaque) > > > return qemu_file_get_error(f); > > > } > > > > > > +static int vfio_start_dirty_page_tracking(VFIODevice *vbasedev, bool > > > start) > > > > I find 'start' functions that may also stop something a bit confusing. > > Maybe vfio_toggle_dirty_page_tracking()? > > I don't think toggle is any better; I always think of toggle as flipping > the state to the other state. > vfio_set_dirty_page_tracking maybe? Sounds good to me.