Re: [Qemu-devel] [PATCH 17/20] migration-test: Clean up string interpolation into QMP, part 1

2018-07-16 Thread Markus Armbruster
Juan Quintela  writes:

> Markus Armbruster  wrote:
>> Leaving interpolation into JSON to qmp() is more robust than building
>> QMP input manually, as explained in the recent commit "tests: Clean up
>> string interpolation into QMP input (simple cases)".
>>
>> migrate_recover() builds QMP input manually because wait_command()
>> can't interpolate.  Well, it can since the previous commit.  Simplify
>> accordingly.
>>
>> Bonus: gets rid of a non-literal format string.  A step towards
>> compile-time format string checking without triggering
>> -Wformat-nonliteral.
>>
>> Cc: Juan Quintela 
>> Cc: Dr. David Alan Gilbert 
>> Signed-off-by: Markus Armbruster 
>
> Reviewed-by: Juan Quintela 
>
> Why, o why it needs to be so difficult!!!

At least the series improves the interface from Rusty's API level -4
"Follow common convention and you'll get it wrong" to API level 4
"Follow common convention and you'll get it right", and for some kind of
mistakes even to API level 8 "The compiler will warn if you get it
wrong."

Thanks!



Re: [Qemu-devel] [PATCH 17/20] migration-test: Clean up string interpolation into QMP, part 1

2018-07-12 Thread Juan Quintela
Markus Armbruster  wrote:
> Leaving interpolation into JSON to qmp() is more robust than building
> QMP input manually, as explained in the recent commit "tests: Clean up
> string interpolation into QMP input (simple cases)".
>
> migrate_recover() builds QMP input manually because wait_command()
> can't interpolate.  Well, it can since the previous commit.  Simplify
> accordingly.
>
> Bonus: gets rid of a non-literal format string.  A step towards
> compile-time format string checking without triggering
> -Wformat-nonliteral.
>
> Cc: Juan Quintela 
> Cc: Dr. David Alan Gilbert 
> Signed-off-by: Markus Armbruster 

Reviewed-by: Juan Quintela 

Why, o why it needs to be so difficult!!!