On Mon, Apr 28, 2025 at 05:39:46PM +0200, Cédric Le Goater wrote:

> > +static void vfio_device_get_all_region_info(VFIODevice *vbasedev)
> > +{
> > +    struct vfio_region_info *info;
> > +    int i;
> > +
> > +    for (i = 0; i < vbasedev->num_regions; i++) {
> > +        vfio_device_get_region_info(vbasedev, i, &info);
> 
> if the vfio_device_get_all_region_info() routine queries *all* region
> infos to fill the ->reginfo[] cache array, why do we also need the
> lazy cache filling method in vfio_device_get_region_info() ? This looks
> redundant to me. I would rather have vfio_device_get_region_info()
> operate on the cache only.

I realised I'm not confident about doing this: in theory, a vfio device region
could later become valid based on some change in operation (and hence get region
info would then subsequently work post setup). Instead, I'm going to drop the
"get all" and operate only in caching mode, does that sound OK?

regards
john

Reply via email to