Re: [PATCH] migration: introduce decompress-error-check

Xiao Guangrong
2018-04-26T13:18:01Z

On 04/26/2018 05:34 PM, Dr. David Alan Gilbert wrote:
> * guangrong.xiao@gmail.com (guangrong.xiao@gmail.com) wrote:
>> From: Xiao Guangrong <xiaoguangrong@tencent.com>
>>
>> QEMU 2.13 enables strict check for compression & decompression to
>> make the migration more robuster, that depends on the source to fix
>> the internal design which triggers the unexpected error conditions
>
> Hmm that's painful!

Yup, i will think it more carefully next time. :(

>
>> To make it work for migrating old version QEMU to 2.13 QEMU, we
>> introduce this parameter to disable the error check on the
>> destination
>>
>> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>
>> ---
>> hmp.c | 8 ++++++++
>> migration/migration.c | 19 +++++++++++++++++++
>> migration/migration.h | 1 +
>> migration/ram.c | 2 +-
>> qapi/migration.json | 43 +++++++++++++++++++++++++++++++++++++++----
>> 5 files changed, 68 insertions(+), 5 deletions(-)
>>
>> diff --git a/hmp.c b/hmp.c
>> index 898e25f3e1..f0b934368b 100644
>> --- a/hmp.c
>> +++ b/hmp.c
>> @@ -329,6 +329,10 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
>> monitor_printf(mon, "%s: %u\n",
>> MigrationParameter_str(MIGRATION_PARAMETER_DECOMPRESS_THREADS),
>> params->decompress_threads);
>> + assert(params->has_decompress_error_check);
>> + monitor_printf(mon, "%s: %s\n",
>> + MigrationParameter_str(MIGRATION_PARAMETER_DECOMPRESS_ERROR_CHECK),
>> + params->decompress_error_check ? "on" : "off");
>
> Since it's a bool, this should be a migration-capability rather than a
> parameter I think.
>

The parameter, @block-incremental, it is also a bool, i think it is okay to
decompress-error-check as well, and it is one of the configurations
of decompression, it is better to group them. Right? :)

> Also, we need to make sure it defaults to off for compatibility.

Yes, the parameter is allocated by zalloc, it has already been false on
default, do you think we should make it be false explicitly?

>
> Other than that, I think it's OK.

Thank you, Dave!