diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-02-29 12:30:14 -0300 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-03-01 15:42:04 +0800 |
commit | f427d90b9898dd7a718b645eeccd9d0ee75d4295 (patch) | |
tree | 71f7e5e2468c3a712a19c28c0613224f7fdd4e30 /migration/migration.c | |
parent | 9d01778af8e39f5b0f101d0a9f32215717604bef (diff) |
migration/multifd: Support outgoing mapped-ram stream format
The new mapped-ram stream format uses a file transport and puts ram
pages in the migration file at their respective offsets and can be
done in parallel by using the pwritev system call which takes iovecs
and an offset.
Add support to enabling the new format along with multifd to make use
of the threading and page handling already in place.
This requires multifd to stop sending headers and leaving the stream
format to the mapped-ram code. When it comes time to write the data, we
need to call a version of qio_channel_write that can take an offset.
Usage on HMP is:
(qemu) stop
(qemu) migrate_set_capability multifd on
(qemu) migrate_set_capability mapped-ram on
(qemu) migrate_set_parameter max-bandwidth 0
(qemu) migrate_set_parameter multifd-channels 8
(qemu) migrate file:migfile
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240229153017.2221-21-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r-- | migration/migration.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/migration/migration.c b/migration/migration.c index faeb75a59b..b9baab543a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -140,12 +140,14 @@ static bool transport_supports_multi_channels(MigrationAddress *addr) if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { SocketAddress *saddr = &addr->u.socket; - return saddr->type == SOCKET_ADDRESS_TYPE_INET || - saddr->type == SOCKET_ADDRESS_TYPE_UNIX || - saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; + return (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_FILE) { + return migrate_mapped_ram(); + } else { + return false; } - - return false; } static bool migration_needs_seekable_channel(void) @@ -1985,6 +1987,11 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, error_setg(errp, "Cannot use TLS with mapped-ram"); return false; } + + if (migrate_multifd_compression()) { + error_setg(errp, "Cannot use compression with mapped-ram"); + return false; + } } if (migrate_mode_is_cpr(s)) { |