*/
#include "qemu/osdep.h"
+#include "qapi/compat-policy.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/visitor.h"
return false;
}
- if (lookup->flags && (lookup->flags[value] & QAPI_ENUM_DEPRECATED)) {
- switch (v->compat_policy.deprecated_input) {
- case COMPAT_POLICY_INPUT_ACCEPT:
- break;
- case COMPAT_POLICY_INPUT_REJECT:
- error_setg(errp, "Deprecated value '%s' disabled by policy",
- enum_str);
- return false;
- case COMPAT_POLICY_INPUT_CRASH:
- default:
- abort();
- }
+ if (lookup->special_features
+ && !compat_policy_input_ok(lookup->special_features[value],
+ &v->compat_policy,
+ ERROR_CLASS_GENERIC_ERROR,
+ "value", enum_str, errp)) {
+ return false;
}
*obj = value;