On Mon, Jun 27, 2022 at 07:45:04AM +0000, Tian, Kevin wrote: > > From: Yishai Hadas <yishaih@xxxxxxxxxx> > > Sent: Sunday, June 26, 2022 4:40 PM > > @@ -1534,8 +1534,8 @@ vfio_ioctl_device_feature_mig_device_state(struct > > vfio_device *device, > > struct file *filp = NULL; > > int ret; > > > > - if (!device->ops->migration_set_state || > > - !device->ops->migration_get_state) > > + if (!device->mig_ops->migration_set_state || > > + !device->mig_ops->migration_get_state) > > return -ENOTTY; > > > > device->mig_ops could be NULL. > > I still think that it's cleaner to do above check when registering the device > while leaving only a simple check on mig_ops here and later. While at it > you can also include check on VFIO_MIGRATION_STOP_COPY since the uAPI > claims it must be set in migration_flags. All those checks can be done > once at registration point. It makes sense, I also prefer validating ops construction on registration. Jason