vfio: Register SaveVMHandlers for VFIO device
commit7c2f5f75f94a8820023a46169a4369fd8189a23c
authorKirti Wankhede <kwankhede@nvidia.com>
Mon, 26 Oct 2020 09:36:17 +0000 (26 15:06 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Sun, 1 Nov 2020 19:30:50 +0000 (1 12:30 -0700)
tree245decd5e45195cf1dc659cd62bdaa926d0efac4
parent050c588c2ef6edd75769e6c4869d0ad625d5be90
vfio: Register SaveVMHandlers for VFIO device

Define flags to be used as delimiter in migration stream for VFIO devices.
Added .save_setup and .save_cleanup functions. Map & unmap migration
region from these functions at source during saving or pre-copy phase.

Set VFIO device state depending on VM's state. During live migration, VM is
running when .save_setup is called, _SAVING | _RUNNING state is set for VFIO
device. During save-restore, VM is paused, _SAVING state is set for VFIO device.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/migration.c
hw/vfio/trace-events