On Mon, Nov 02, 2020 at 10:27:54AM +0000, Stefan Hajnoczi wrote: > On Mon, Nov 02, 2020 at 11:00:12AM +0800, Jason Wang wrote: > > > > On 2020/10/30 下午7:13, Stefan Hajnoczi wrote: > > > > I still don't get why it must be opaque. > > > If the device state format needs to be in the VMM then each device > > > needs explicit enablement in each VMM (QEMU, cloud-hypervisor, etc). > > > > > > Let's invert the question: why does the VMM need to understand the > > > device state of a_passthrough_ device? > > > > > > It's not a 100% passthrough device if you want to support live migration. > > E.g the device state save and restore is not under the control of drivers in > > the guest. > > VFIO devices are already not pure passthrough (even without mdev) since > the PCI bus is emulated and device-specific quirks may be implemented.
So since it's not a pure passthrough anyway, let's try to introduce some standards even if we can not always enforce them. > Adding device state save/load does not change anything here. It's as good a time as any to try to standardize things and not just let each driver do whatever it wants. In particular if you consider things like cross version support it's a hard problem where vendors are sure to get it wrong without guidance. -- MST