Markus Armbruster <[email protected]> writes: > Fabiano Rosas <[email protected]> writes: > >> The migrate_set_parameter_completion function is the last user of the >> MigrationParameter enum. > > Not true, there's still the assertion in > migrate_mark_all_params_present(), and hmp_completion_single() in > tests/qtest/migration/misc-tests.c. > > The assertion is unclean: it uses MIGRATION_PARAMETER__MAX for number of > MigrationParameters members, which tacitly assumes MigrationParameter > matches MigrationParameters. >
I'm not sure I understand what you mean here. The usefulness of MigrationParameter is quite diminished if it doesn't always match the members of MigrationParameters. In fact... could we code-generate the enum from MigrationParameters without the need for explicitly declaring MigrationParameter? That way we keep the usefulness of having a lookup function and a "max" and do away with the task of updating MigrationParameter to match MigrationParameters. >> Write the code using an output visitor and >> QDict instead so we can remove the enum in a future patch. >> >> Signed-off-by: Fabiano Rosas <[email protected]>
