Markus Armbruster <[email protected]> wrote: > Juan Quintela <[email protected]> writes: >> + case MIGRATION_PARAMETER_MULTIFD_COMPRESS: >> + p->has_multifd_compress = true; >> + visit_type_MultifdCompress(v, param, &compress_type, &err); >> + if (err) { >> + break; >> + } >> + if (compress_type < 0 || compress_type >= MULTIFD_COMPRESS__MAX) { >> + error_setg(&err, "Invalid multifd_compress option %s", >> valuestr); >> + break; >> + } > > This should never happen. If you want to check anyway, make it an > assertion. > > Just in case you don't believe me, or are curious: > > visit_type_MultifdCompress() wraps around visit_type_enum(), passing it > &MultifdCompress_lookup. > > Since @v is an input visitor, visit_type_enum() wraps around > input_type_enum(). > > input_type_enum() computes the value to store in @compress_type with > qapi_enum_parse(). > > To get here, visit_type_MultifdCompress() must have succeeded, > i.e. visit_type_enum(), input_type_enum() and qapi_enum_parse() all > succeded. > > On success, qapi_enum_parse() returns one of the values in > MultifdCompress_lookup, i.e. a member of enum MultifdCompress other than > MULTIFD_COMPRESS__MAX.
Fixed, thanks. >> @@ -3353,6 +3362,9 @@ void migration_global_dump(Monitor *mon) >> #define DEFINE_PROP_MIG_CAP(name, x) \ >> DEFINE_PROP_BOOL(name, MigrationState, enabled_capabilities[x], false) >> >> +#define DEFINE_PROP_MULTIFD_COMPRESS(_n, _s, _f, _d) \ >> + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_multifd_compress, >> MultifdCompress) >> + > > Did you forget to move this? It appears that yes. I tried to move the other part out of qdev-properties, failed. And then forgot to move this bit. Thanks. Later, Juan.
