aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-02-29 12:30:16 -0300
committerPeter Xu <peterx@redhat.com>2024-03-01 15:42:04 +0800
commitdecdc76772c453ff1444612e910caa0d45cd8eac (patch)
tree508c2a76e799a056fd00b89f1e69ff98a4d67357 /migration/migration.c
parenta49d15a38d3db0aca7e55850c036d1abbc09a0ea (diff)
downloadqemu-decdc76772c453ff1444612e910caa0d45cd8eac.zip
qemu-decdc76772c453ff1444612e910caa0d45cd8eac.tar.gz
qemu-decdc76772c453ff1444612e910caa0d45cd8eac.tar.bz2
migration/multifd: Add mapped-ram support to fd: URI
If we receive a file descriptor that points to a regular file, there's nothing stopping us from doing multifd migration with mapped-ram to that file. Enable the fd: URI to work with multifd + mapped-ram. Note that the fds passed into multifd are duplicated because we want to avoid cross-thread effects when doing cleanup (i.e. close(fd)). The original fd doesn't need to be duplicated because monitor_get_fd() transfers ownership to the caller. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20240229153017.2221-23-farosas@suse.de Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c
index b9baab5..a49fcd5 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -140,6 +140,10 @@ static bool transport_supports_multi_channels(MigrationAddress *addr)
if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) {
SocketAddress *saddr = &addr->u.socket;
+ if (saddr->type == SOCKET_ADDRESS_TYPE_FD) {
+ return migrate_mapped_ram();
+ }
+
return (saddr->type == SOCKET_ADDRESS_TYPE_INET ||
saddr->type == SOCKET_ADDRESS_TYPE_UNIX ||
saddr->type == SOCKET_ADDRESS_TYPE_VSOCK);