aboutsummaryrefslogtreecommitdiff
path: root/include/qapi/util.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-10-25 06:24:04 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-10-27 17:19:34 +0200
commitaa2370444b62f8f9a809c024d0c41cb40658a5c3 (patch)
tree7b55c4687b9ba2f2c426b106772c14e82761db5a /include/qapi/util.h
parented29bb28f8b0b17e965efcc2535fc32e101e3ceb (diff)
downloadqemu-aa2370444b62f8f9a809c024d0c41cb40658a5c3.zip
qemu-aa2370444b62f8f9a809c024d0c41cb40658a5c3.tar.gz
qemu-aa2370444b62f8f9a809c024d0c41cb40658a5c3.tar.bz2
qapi: Implement deprecated-input={reject,crash} for enum values
This copies the code implementing the policy from qapi/qmp-dispatch.c to qapi/qobject-input-visitor.c. Tolerable, but if we acquire more copies, we should look into factoring them out. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Message-Id: <20211025042405.3762351-5-armbru@redhat.com>
Diffstat (limited to 'include/qapi/util.h')
-rw-r--r--include/qapi/util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/qapi/util.h b/include/qapi/util.h
index d7bfb30..257c600 100644
--- a/include/qapi/util.h
+++ b/include/qapi/util.h
@@ -11,9 +11,13 @@
#ifndef QAPI_UTIL_H
#define QAPI_UTIL_H
+/* QEnumLookup flags */
+#define QAPI_ENUM_DEPRECATED 1
+
typedef struct QEnumLookup {
const char *const *array;
- int size;
+ const unsigned char *const flags;
+ const int size;
} QEnumLookup;
const char *qapi_enum_lookup(const QEnumLookup *lookup, int val);