> if (device->ops->flags & VFIO_DEVICE_NEEDS_KVM) > { Nit: this is not the normal brace placement. But what is you diff against anyway? The one Matthew sent did away with the VFIO_DEVICE_NEEDS_KVM flags, which does the wrong thing for zpci, so it can't be that.. Also if we want to do major code movement, it really needs to go into a separate patch or patches, as the combinations of all these moves with actual code changes is almost unreadable.