mirror of
https://github.com/qemu/qemu.git
synced 2025-08-10 12:46:22 +00:00

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>
25 lines
880 B
C
25 lines
880 B
C
/*
|
|
* Copyright (c) 2021-2023 Oracle and/or its affiliates.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef QEMU_MIGRATION_FILE_H
|
|
#define QEMU_MIGRATION_FILE_H
|
|
|
|
#include "qapi/qapi-types-migration.h"
|
|
#include "io/task.h"
|
|
#include "channel.h"
|
|
|
|
void file_start_incoming_migration(FileMigrationArgs *file_args, Error **errp);
|
|
|
|
void file_start_outgoing_migration(MigrationState *s,
|
|
FileMigrationArgs *file_args, Error **errp);
|
|
int file_parse_offset(char *filespec, uint64_t *offsetp, Error **errp);
|
|
void file_cleanup_outgoing_migration(void);
|
|
bool file_send_channel_create(gpointer opaque, Error **errp);
|
|
int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,
|
|
int niov, RAMBlock *block, Error **errp);
|
|
#endif
|