@@ -12,8 +12,8 @@
#define QAPI_UTIL_H
typedef enum {
- QAPI_DEPRECATED,
- QAPI_UNSTABLE,
+ QAPI_FEATURE_DEPRECATED,
+ QAPI_FEATURE_UNSTABLE,
} QapiSpecialFeature;
typedef struct QEnumLookup {
@@ -43,13 +43,13 @@ bool compat_policy_input_ok(unsigned special_features,
const char *kind, const char *name,
Error **errp)
{
- if ((special_features & 1u << QAPI_DEPRECATED)
+ if ((special_features & 1u << QAPI_FEATURE_DEPRECATED)
&& !compat_policy_input_ok1("Deprecated",
policy->deprecated_input,
error_class, kind, name, errp)) {
return false;
}
- if ((special_features & (1u << QAPI_UNSTABLE))
+ if ((special_features & (1u << QAPI_FEATURE_UNSTABLE))
&& !compat_policy_input_ok1("Unstable",
policy->unstable_input,
error_class, kind, name, errp)) {
@@ -214,9 +214,9 @@ static bool qobject_output_policy_skip(Visitor *v, const char *name,
{
CompatPolicy *pol = &v->compat_policy;
- return ((special_features & 1u << QAPI_DEPRECATED)
+ return ((special_features & 1u << QAPI_FEATURE_DEPRECATED)
&& pol->deprecated_output == COMPAT_POLICY_OUTPUT_HIDE)
- || ((special_features & 1u << QAPI_UNSTABLE)
+ || ((special_features & 1u << QAPI_FEATURE_UNSTABLE)
&& pol->unstable_output == COMPAT_POLICY_OUTPUT_HIDE);
}
@@ -41,7 +41,7 @@
def gen_special_features(features: Sequence[QAPISchemaFeature]) -> str:
- special_features = [f"1u << QAPI_{feat.name.upper()}"
+ special_features = [f"1u << QAPI_FEATURE_{feat.name.upper()}"
for feat in features if feat.is_special()]
return ' | '.join(special_features) or '0'
This more clearly distinguishes the feature constants from other QAPI constants. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- include/qapi/util.h | 4 ++-- qapi/qapi-util.c | 4 ++-- qapi/qobject-output-visitor.c | 4 ++-- scripts/qapi/gen.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)