aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2025-03-04 23:03:43 +0100
committerCédric Le Goater <clg@redhat.com>2025-03-06 06:47:33 +0100
commita1131aa94256d1007b4267ff9e79c3b4ada6e2b9 (patch)
treef45daab2906e533a2cf7787e69cfb9d06d46b7d7
parent99fab22350e4eed1d8a238ed97c77b1a5ee77dd4 (diff)
downloadqemu-a1131aa94256d1007b4267ff9e79c3b4ada6e2b9.zip
qemu-a1131aa94256d1007b4267ff9e79c3b4ada6e2b9.tar.gz
qemu-a1131aa94256d1007b4267ff9e79c3b4ada6e2b9.tar.bz2
migration/multifd: Add multifd_device_state_supported()
Since device state transfer via multifd channels requires multifd channels with packets and is currently not compatible with multifd compression add an appropriate query function so device can learn whether it can actually make use of it. Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Link: https://lore.kernel.org/qemu-devel/1ff0d98b85f470e5a33687406e877583b8fab74e.1741124640.git.maciej.szmigiero@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--include/migration/misc.h1
-rw-r--r--migration/multifd-device-state.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/migration/misc.h b/include/migration/misc.h
index bd3b725..273ebfc 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -121,5 +121,6 @@ bool migrate_uri_parse(const char *uri, MigrationChannel **channel,
/* migration/multifd-device-state.c */
bool multifd_queue_device_state(char *idstr, uint32_t instance_id,
char *data, size_t len);
+bool multifd_device_state_supported(void);
#endif
diff --git a/migration/multifd-device-state.c b/migration/multifd-device-state.c
index 64d8ca1..3097ffa 100644
--- a/migration/multifd-device-state.c
+++ b/migration/multifd-device-state.c
@@ -13,6 +13,7 @@
#include "qemu/lockable.h"
#include "migration/misc.h"
#include "multifd.h"
+#include "options.h"
static struct {
QemuMutex queue_job_mutex;
@@ -111,3 +112,9 @@ bool multifd_queue_device_state(char *idstr, uint32_t instance_id,
return true;
}
+
+bool multifd_device_state_supported(void)
+{
+ return migrate_multifd() && !migrate_mapped_ram() &&
+ migrate_multifd_compression() == MULTIFD_COMPRESSION_NONE;
+}