[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 19/29] migration/multifd: Add outgoing QIOChannelFile supp
From: |
Peter Xu |
Subject: |
Re: [PATCH v2 19/29] migration/multifd: Add outgoing QIOChannelFile support |
Date: |
Tue, 31 Oct 2023 16:11:35 -0400 |
On Mon, Oct 23, 2023 at 05:35:58PM -0300, Fabiano Rosas wrote:
> Allow multifd to open file-backed channels. This will be used when
> enabling the fixed-ram migration stream format which expects a
> seekable transport.
>
> The QIOChannel read and write methods will use the preadv/pwritev
> versions which don't update the file offset at each call so we can
> reuse the fd without re-opening for every channel.
>
> Note that this is just setup code and multifd cannot yet make use of
> the file channels.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
> migration/file.c | 64 +++++++++++++++++++++++++++++++++++++++++--
> migration/file.h | 10 +++++--
> migration/migration.c | 2 +-
> migration/multifd.c | 14 ++++++++--
> migration/options.c | 7 +++++
> migration/options.h | 1 +
> 6 files changed, 90 insertions(+), 8 deletions(-)
>
> diff --git a/migration/file.c b/migration/file.c
> index cf5b1bf365..93b9b7bf5d 100644
> --- a/migration/file.c
> +++ b/migration/file.c
> @@ -17,6 +17,12 @@
>
> #define OFFSET_OPTION ",offset="
>
> +static struct FileOutgoingArgs {
> + char *fname;
> + int flags;
> + int mode;
> +} outgoing_args;
> +
> /* Remove the offset option from @filespec and return it in @offsetp. */
>
> static int file_parse_offset(char *filespec, uint64_t *offsetp, Error **errp)
> @@ -36,13 +42,62 @@ static int file_parse_offset(char *filespec, uint64_t
> *offsetp, Error **errp)
> return 0;
> }
>
> +static void qio_channel_file_connect_worker(QIOTask *task, gpointer opaque)
> +{
> + /* noop */
> +}
> +
> +static void file_migration_cancel(Error *errp)
> +{
> + MigrationState *s;
> +
> + s = migrate_get_current();
> +
> + migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
> + MIGRATION_STATUS_FAILED);
This doesn't sound right to set FAILED here, then call cancel() afterwards
(which will try to set it to CANCELLING).
For socket based, multifd sets error and kick main in
multifd_new_send_channel_cleanup(). Can it be done similarly, rather than
calling migration_cancel()?
> + migration_cancel(errp);
> +}
--
Peter Xu
- Re: [PATCH v2 16/29] migration/ram: Add support for 'fixed-ram' migration restore, (continued)
Re: [PATCH v2 19/29] migration/multifd: Add outgoing QIOChannelFile support,
Peter Xu <=
[PATCH v2 18/29] migration/multifd: Allow multifd without packets, Fabiano Rosas, 2023/10/23
[PATCH v2 20/29] migration/multifd: Add incoming QIOChannelFile support, Fabiano Rosas, 2023/10/23
[PATCH v2 24/29] migration/ram: Ignore multifd flush when doing fixed-ram migration, Fabiano Rosas, 2023/10/23
[PATCH v2 21/29] migration/multifd: Add pages to the receiving side, Fabiano Rosas, 2023/10/23