On Mon, Jun 01, 2026 at 10:39:26AM -0300, Fabiano Rosas wrote: > A bit idiosyncratic, but I don't have any better suggestions.
One thing I don't think proper with the current approach: if it's a real "priority" it should be invoked always with high->low order, no matter if running=true or not.. but that's not what will happen if we encode it with the "depth" field. That is an implication that we have two demands, and they aren't the same, but this solution wrongly packed them together. In 2023, VFIO already introduced VMChangeStateEntry.prepare_cb(). That is a real impl of prority queues with only two: prepare_cb() always has higher priority than the cb() itself. Can VFIO simply leverage this existing interface, instead of hijacking "depth" in an unwanted way? I believe the _P2P states still need to happen first for all vfio devices, then it can do the next step. Logically I think it can also be done internally within VFIO by proper impl of these two callbacks, to achieve both: - Proper transition to P2P states first for all devices, meanwhile, - Proper concurrency of all VFIO devices on device state transitions Would that work in a cleaner way? Thanks, -- Peter Xu
