From: "Maciej S. Szmigiero" <maciej.szmigi...@oracle.com> Add vfio_multifd_transfer_supported() function that tells whether the multifd device state transfer is supported.
Signed-off-by: Maciej S. Szmigiero <maciej.szmigi...@oracle.com> --- hw/vfio/migration-multifd.c | 6 ++++++ hw/vfio/migration-multifd.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c index 760b110a39b9..7328ad8e925c 100644 --- a/hw/vfio/migration-multifd.c +++ b/hw/vfio/migration-multifd.c @@ -83,3 +83,9 @@ static VFIOStateBuffer *vfio_state_buffers_at(VFIOStateBuffers *bufs, guint idx) { return &g_array_index(bufs->array, VFIOStateBuffer, idx); } + +bool vfio_multifd_transfer_supported(void) +{ + return multifd_device_state_supported() && + migrate_send_switchover_start(); +} diff --git a/hw/vfio/migration-multifd.h b/hw/vfio/migration-multifd.h index 64d117b27210..8fe004c1da81 100644 --- a/hw/vfio/migration-multifd.h +++ b/hw/vfio/migration-multifd.h @@ -12,4 +12,6 @@ #include "hw/vfio/vfio-common.h" +bool vfio_multifd_transfer_supported(void); + #endif