[PATCH v2 2/5] qapi: Add feature flags to enum members

Markus Armbruster armbru at redhat.com
Thu Oct 21 08:48:21 UTC 2021


Kevin Wolf <kwolf at redhat.com> writes:

> Am 09.10.2021 um 14:09 hat Markus Armbruster geschrieben:
>> This is quite similar to commit 84ab008687 "qapi: Add feature flags to
>> struct members", only for enums instead of structs.
>> 
>> Special feature flag 'deprecated' is silently ignored there.  This is
>> okay only because it will be implemented shortly.
>> 
>> Signed-off-by: Markus Armbruster <armbru at redhat.com>
>> Reviewed-by: Eric Blake <eblake at redhat.com>
>
> Should we have a test case for an invalid value for 'features'?

We have coverage, just not in every context.

struct context:

    tests/qapi-schema/features-bad-type.json
    tests/qapi-schema/features-deprecated-type.json
    tests/qapi-schema/features-duplicate-name.json
    tests/qapi-schema/features-if-invalid.json
    tests/qapi-schema/features-missing-name.json
    tests/qapi-schema/features-name-bad-type.json
    tests/qapi-schema/features-no-list.json
    tests/qapi-schema/features-unknown-key.json

struct member context:

    tests/qapi-schema/features-member-bad-type.json
    tests/qapi-schema/features-member-duplicate-name.json
    tests/qapi-schema/features-member-if-invalid.json
    tests/qapi-schema/features-member-missing-name.json
    tests/qapi-schema/features-member-name-bad-type.json
    tests/qapi-schema/features-member-no-list.json
    tests/qapi-schema/features-member-unknown-key.json

These are basically the same, except for features-deprecated-type.json,
which makes sense only in struct context.

The other contexts are enum, union, alternate, command, event, and now
enum member.

My excuse for skipping contexts is that the errors come from
check_features() for all them.




More information about the libvir-list mailing list