Prasad Pandit <[email protected]> writes:

> On Tue, 28 Jan 2025 at 11:00, Prasad Pandit <[email protected]> wrote:
>> >     for (int i = 0; i < MIGRATION_CAPABILITY__MAX; i++) {
>> >         if (args->caps[i]) {
>> >             migrate_set_capability(from, 
>> > MigrationCapability_str(args->caps[i]), true);
>> >             migrate_set_capability(to, 
>> > MigrationCapability_str(args->caps[i]), true);
>> >         }
>> >     }
>> >
>> > We could also set the number of channels as a default value. The tests
>> > could overwrite it from the hook if needed.
>>
>> * Yes, this seems like a better option, I'll give it a try.
>
> Please see -> 
> https://notebin.de/?317b9fc90a9a910d#dGKqq4r5pyMYU5SXYLFhd8wrzKRCxCcokTkTRBCUK7w
>
> @Fabiano: does this look okay? If it is, I'll further remove
> corresponding boolean fields from MigrateCommon struct etc.

You could include qapi-types-migration.h and use the actual enum, that
avoids the burden of having to keep the tests in sync with the code.

(I don't think keeping the caps in sync with the current-version tests
would break the compat tests, but please consider that as well)

And a generic helper that calls migrate_set_capability() for any
capabilites set. That solves the capabilities issue for all tests. We
can then move some default parameters setting into that function and
that should already reduce the number of hooks needed.

You can include it in this series or send a separate one, whatever is
easier for you. But we need to base this one on top of it eventually, I
would just send everything at once.

>
> Thank you.
> ---
>   - Prasad

Reply via email to