On Wed, Jun 04, 2025 at 03:48:40PM +0200, Cédric Le Goater wrote:
> > I don't see any advantage to making this a class attribute.  I looked for 
> > examples
> > of using such attributes for vfio to configure pci, and found very little.  
> > It
> > sounds like overkill since vfio already sets and gets PCIDevice members 
> > directly
> > in many places.
> > 
> > I defined skip_reset_on_cpr based on this existing example:
> > 
> > vfio_instance_init()
> >      pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS
> 
> pci_dev->cap_present can be modified at realize time. skip_reset_on_cpr
> is a constant, for which a class attribute are more appropriate.
> This is minor.
> 
> Michael,
> 
>   Are you ok with the 'skip_reset_on_cpr' bool ?

Generally yes, but maybe cap_present bit is even cleaner?
vfio already pokes at it, and we have history of encoding
quirks there, see QEMU_PCIE_LNKSTA_DLLLA_BITNR for example.


> > > I wonder if the resettable interface, and more specifically the
> > > RESET_TYPE_SNAPSHOT_LOAD type, might be useful. Have you explored
> > > this alternative ?
> > 
> > RESET_TYPE_SNAPSHOT_LOAD (or a new type such as RESET_TYPE_CPR) would skip
> > reset for all devices, but we only skip for vfio_pci.  All other devices
> > (including virtio) save and restore state using standard migration vmstate,
> > and must call reset.
> OK.
> 
> C.


Reply via email to