mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
vfio/migration: Add P2P support for VFIO migration
VFIO migration uAPI defines an optional intermediate P2P quiescent state. While in the P2P quiescent state, P2P DMA transactions cannot be initiated by the device, but the device can respond to incoming ones. Additionally, all outstanding P2P transactions are guaranteed to have been completed by the time the device enters this state. The purpose of this state is to support migration of multiple devices that might do P2P transactions between themselves. Add support for P2P migration by transitioning all the devices to the P2P quiescent state before stopping or starting the devices. Use the new VMChangeStateHandler prepare_cb to achieve that behavior. This will allow migration of multiple VFIO devices if all of them support P2P migration. Signed-off-by: Avihai Horon <avihaih@nvidia.com> Tested-by: YangHang Liu <yanghliu@redhat.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
3d4d0f0e06
commit
94f775e428
4 changed files with 105 additions and 41 deletions
|
@ -441,14 +441,16 @@ bool vfio_device_state_is_running(VFIODevice *vbasedev)
|
|||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_RUNNING;
|
||||
return migration->device_state == VFIO_DEVICE_STATE_RUNNING ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_RUNNING_P2P;
|
||||
}
|
||||
|
||||
bool vfio_device_state_is_precopy(VFIODevice *vbasedev)
|
||||
{
|
||||
VFIOMigration *migration = vbasedev->migration;
|
||||
|
||||
return migration->device_state == VFIO_DEVICE_STATE_PRE_COPY;
|
||||
return migration->device_state == VFIO_DEVICE_STATE_PRE_COPY ||
|
||||
migration->device_state == VFIO_DEVICE_STATE_PRE_COPY_P2P;
|
||||
}
|
||||
|
||||
static bool vfio_devices_all_dirty_tracking(VFIOContainer *container)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue