[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs
From: |
Daniel P . Berrangé |
Subject: |
Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs |
Date: |
Fri, 15 Mar 2024 08:55:42 +0000 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Fri, Mar 15, 2024 at 12:20:40AM -0300, Fabiano Rosas wrote:
> The fd: URI has supported migration to a file or socket since before
> QEMU 8.2. In 8.2 we added the file: URI that supported migration to a
> file. So now we have two ways (three if you count exec:>cat) to
> migrate to a file. Fine.
>
> However,
>
> In 8.2 we also added the new qmp_migrate API that uses a JSON channel
> list instead of the URI. It added two migration transports SOCKET and
> FILE. It was decided that the new API would classify the fd migration
> as a type of socket migration, neglecting the fact that the fd.c code
> also supported file migrations.
>
> In 9.0 we're adding support for fd + multifd + mapped-ram, which is
> tied to the file migration. This was implemented in fd.c, which is
> only reachable when the SOCKET address type is used.
>
> The result of this is that we're asking users of the new API to create (1)
> something called a "socket" to perform migration to a plain file. And
> creating something called a "file" provides no way of passing in a
> file descriptor. This is confusing.
The 'file:' protocol eventually calls into qemu_open, and this
transparently allows for FD passing using /dev/fdset/NNN syntax
to pass in FDs.
> diff --git a/qapi/migration.json b/qapi/migration.json
> index aa1b39bce1..37f4b9c6fb 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1656,13 +1656,20 @@
> #
> # @filename: The file to receive the migration stream
> #
> +# @fd: A file descriptor name or number. File descriptors must be
> +# first added with the 'getfd' command. (since 9.0).
> +#
> # @offset: The file offset where the migration stream will start
> #
> +# Since 9.0, all members are optional, but at least one of @filename
> +# or @fd are required.
> +#
> # Since: 8.2
> ##
> { 'struct': 'FileMigrationArgs',
> - 'data': { 'filename': 'str',
> - 'offset': 'uint64' } }
> + 'data': { '*filename': 'str',
> + '*fd': 'str',
> + '*offset': 'uint64' } }
Adding 'fd' here is not desirable, because 'filename' is
resolved via qemu_open which allows for FD passing without
introducing any new syntax in interfaces which take filenames.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH v3 0/3] migration mapped-ram fixes, Fabiano Rosas, 2024/03/14
- [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Fabiano Rosas, 2024/03/14
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs,
Daniel P . Berrangé <=
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Peter Xu, 2024/03/15
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Fabiano Rosas, 2024/03/15
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Peter Xu, 2024/03/15
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Daniel P . Berrangé, 2024/03/19
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Peter Xu, 2024/03/19
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Daniel P . Berrangé, 2024/03/19
- Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs, Peter Xu, 2024/03/19
[PATCH v3 1/3] migration/multifd: Ensure we're not given a socket for file migration, Fabiano Rosas, 2024/03/14