Re: [PATCH vfio 2/2] vfio: Split migration ops from main device ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 19, 2022 at 12:25:50PM +0300, Yishai Hadas wrote:

> Means, staying with a single device_ops but just inline a check whether
> migration is really supported inside the migration get/set state callbacks
> and let the core call it unconditionally.

I find it much cleaner to have op == NULL means unsupported.

As soon as you start linking supported/unsupported to other flags it
can get very complicated fairly fast. I have this experiance from RDMA
where we've spent a long time now ripping out hundreds of flag tests
and replacing them with NULL op checks. Many bugs were fixed doing
this as drivers never fully understood what the flags mean and ended
up with flags set that their driver doesn't properly implement.

The mistake we made in RDMA was not splitting the ops, instead the ops
were left mutable so the driver could load the right combination based
on HW ability.

Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux