aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2025-03-04 23:03:50 +0100
committerCédric Le Goater <clg@redhat.com>2025-03-06 06:47:34 +0100
commit2efa35d34edfeca0d151de8283e52006e2c6cbd4 (patch)
tree97effeabb72aa028151c5aa47a0ec3f04680da69
parent961165122bc8a4cf58eaaab75ff09ba8fc950a88 (diff)
downloadqemu-2efa35d34edfeca0d151de8283e52006e2c6cbd4.zip
qemu-2efa35d34edfeca0d151de8283e52006e2c6cbd4.tar.gz
qemu-2efa35d34edfeca0d151de8283e52006e2c6cbd4.tar.bz2
vfio/migration: Multifd device state transfer - add support checking function
Add vfio_multifd_transfer_supported() function that tells whether the multifd device state transfer is supported. Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Link: https://lore.kernel.org/qemu-devel/8ce50256f341b3d47342bb217cb5fbb2deb14639.1741124640.git.maciej.szmigiero@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--hw/vfio/migration-multifd.c6
-rw-r--r--hw/vfio/migration-multifd.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c
index fa594b3..79fae0b 100644
--- a/hw/vfio/migration-multifd.c
+++ b/hw/vfio/migration-multifd.c
@@ -31,3 +31,9 @@ typedef struct VFIODeviceStatePacket {
uint32_t flags;
uint8_t data[0];
} QEMU_PACKED VFIODeviceStatePacket;
+
+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 5b221c6..1b60d5f 100644
--- a/hw/vfio/migration-multifd.h
+++ b/hw/vfio/migration-multifd.h
@@ -14,4 +14,6 @@
#include "hw/vfio/vfio-common.h"
+bool vfio_multifd_transfer_supported(void);
+
#endif