vfio: Set the priority of the VFIO VM state change handler explicitly
authorShenming Lu <lushenming@huawei.com>
Wed, 10 Mar 2021 03:02:32 +0000 (11:02 +0800)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 16 Mar 2021 16:06:44 +0000 (10:06 -0600)
commit8ce1ff990eff6affbdd0492fe4fc95e113235e35
tree128fa933178e2191764df269e020684064af5191
parentd329f5032e17f3ecc7f8c2c3c5f130ec671000d2
vfio: Set the priority of the VFIO VM state change handler explicitly

In the VFIO VM state change handler when stopping the VM, the _RUNNING
bit in device_state is cleared which makes the VFIO device stop, including
no longer generating interrupts. Then we can save the pending states of
all interrupts in the GIC VM state change handler (on ARM).

So we have to set the priority of the VFIO VM state change handler
explicitly (like virtio devices) to ensure it is called before the
GIC's in saving.

Signed-off-by: Shenming Lu <lushenming@huawei.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20210310030233.1133-3-lushenming@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/migration.c