Fabiano Rosas <[email protected]> writes:
> Add the direct-io migration parameter that tells the migration code to
> use O_DIRECT when opening the migration stream file whenever possible.
>
> This is currently only used for the secondary channels of fixed-ram
> migration, which can guarantee that writes are page aligned.
>
> However the parameter could be made to affect other types of
> file-based migrations in the future.
>
> Signed-off-by: Fabiano Rosas <[email protected]>
When would you want to enable @direct-io, and when would you want to
leave it disabled?
What happens when you enable @direct-io with a migration that cannot use
O_DIRECT?
[...]
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 1317dd32ab..3eb9e2c9b5 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -840,6 +840,9 @@
> # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
> # Defaults to 1. (Since 8.1)
> #
> +# @direct-io: Open migration files with O_DIRECT when possible. Not
> +# all migration transports support this. (since 8.1)
> +#
Please format like
# @direct-io: Open migration files with O_DIRECT when possible. Not
# all migration transports support this. (since 8.1)
to blend in with recent commit a937b6aa739 (qapi: Reformat doc comments
to conform to current conventions).
> # Features:
> #
> # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> @@ -864,7 +867,7 @@
> 'multifd-zlib-level', 'multifd-zstd-level',
> 'block-bitmap-mapping',
> { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] },
> - 'vcpu-dirty-limit'] }
> + 'vcpu-dirty-limit', 'direct-io'] }
>
> ##
> # @MigrateSetParameters:
> @@ -1016,6 +1019,9 @@
> # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
> # Defaults to 1. (Since 8.1)
> #
> +# @direct-io: Open migration files with O_DIRECT when possible. Not
> +# all migration transports support this. (since 8.1)
> +#
Likewise.
> # Features:
> #
> # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> @@ -1058,7 +1064,8 @@
> '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
> '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
> 'features': [ 'unstable' ] },
> - '*vcpu-dirty-limit': 'uint64'} }
> + '*vcpu-dirty-limit': 'uint64',
> + '*direct-io': 'bool' } }
>
> ##
> # @migrate-set-parameters:
> @@ -1230,6 +1237,9 @@
> # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
> # Defaults to 1. (Since 8.1)
> #
> +# @direct-io: Open migration files with O_DIRECT when possible. Not
> +# all migration transports support this. (since 8.1)
> +#
Likewise.
> # Features:
> #
> # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> @@ -1269,7 +1279,8 @@
> '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
> '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
> 'features': [ 'unstable' ] },
> - '*vcpu-dirty-limit': 'uint64'} }
> + '*vcpu-dirty-limit': 'uint64',
> + '*direct-io': 'bool' } }
>
> ##
> # @query-migrate-parameters:
This one is for the migration maintainers: we have MigrationCapability,
set with migrate-set-capabilities, and MigrationParameters, set with
migrate-set-parameters. For a boolean configuration setting, either
works. Which one should we use when?
[...]