From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Yishai Hadas <yishaih@nvidia.com>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"maorg@nvidia.com" <maorg@nvidia.com>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"shameerali.kolothum.thodi@huawei.com"
<shameerali.kolothum.thodi@huawei.com>,
"liulongfang@huawei.com" <liulongfang@huawei.com>
Subject: Re: [PATCH V1 vfio 2/2] vfio: Split migration ops from main device ops
Date: Mon, 27 Jun 2022 15:44:57 -0300 [thread overview]
Message-ID: <20220627184457.GH4147@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52767F6751DDCAA7D38734788CB99@BN9PR11MB5276.namprd11.prod.outlook.com>
On Mon, Jun 27, 2022 at 07:45:04AM +0000, Tian, Kevin wrote:
> > From: Yishai Hadas <yishaih@nvidia.com>
> > 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
prev parent reply other threads:[~2022-06-27 18:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 8:39 [PATCH V1 vfio 0/2] Migration few enhancements Yishai Hadas
2022-06-26 8:39 ` [PATCH V1 vfio 1/2] vfio/mlx5: Protect mlx5vf_disable_fds() upon close device Yishai Hadas
2022-06-26 8:39 ` [PATCH V1 vfio 2/2] vfio: Split migration ops from main device ops Yishai Hadas
2022-06-27 7:45 ` Tian, Kevin
2022-06-27 18:44 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220627184457.GH4147@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=maorg@nvidia.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.