Re: [PATCH v3 08/24] vfio/pci: Retrieve preserved device files after Live Update

David Matlack
2026-03-24T17:06:08Z

On 2026-03-24 09:08 PM, Yi Liu wrote:
> On 3/24/26 07:58, David Matlack wrote:
> > From: Vipin Sharma <vipinsh@google.com>
> >
> > Enable userspace to retrieve preserved VFIO device files from VFIO after
> > a Live Update by implementing the retrieve() and finish() file handler
> > callbacks.
> >
> > Use an anonymous inode when creating the file, since the retrieved
> > device file is not opened through any particular cdev inode, and the
> > cdev inode does not matter in practice.
>
> do we have a list of struct file fields that do not matter?

My understanding is that VFIO only cares about these fields in struct
file:

- private_data: Pointer to struct vfio_device_file
- f_op: Pointer to vfio_device_fops
- f_mapping: Pointer to vfio_device->inode->i_mapping

This is based on cross-referencing VFIO_GROUP_GET_DEVICE_FD (which uses
an anonymous inode) and the cdev code.

> > +err_free_device_file:
> > + kvfree(df);
>
> any reason to use kvfree()?

No this can be kfree(). Will fix in v4.