aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-09-04 13:28:09 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-04 13:28:09 +0100
commit98bfaac788be0ca63d7d010c8d4ba100ff1d8278 (patch)
treea6adc21256f54beb05f428440b0ed0e69bdddc45 /qom
parent32f0f68bb77289b75a82925f712bb52e16eac3ba (diff)
parentebf677c8497ee81537f7ce57b165c978511ccde5 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-09-01-v3' into staging
QAPI patches for 2017-09-01 # gpg: Signature made Mon 04 Sep 2017 12:30:31 BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-09-01-v3: (47 commits) qapi: drop the sentinel in enum array qapi: Change data type of the FOO_lookup generated for enum FOO qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup() qapi: Mechanically convert FOO_lookup[...] to FOO_str(...) qapi: Generate FOO_str() macro for QAPI enum FOO qapi: Avoid unnecessary use of enum lookup table's sentinel qapi: Use qapi_enum_parse() in input_type_enum() crypto: Use qapi_enum_parse() in qcrypto_block_luks_name_lookup() quorum: Use qapi_enum_parse() in quorum_open() block: Use qemu_enum_parse() in blkdebug_debug_breakpoint() hmp: Use qapi_enum_parse() in hmp_migrate_set_parameter() hmp: Use qapi_enum_parse() in hmp_migrate_set_capability() tpm: Clean up model registration & lookup tpm: Clean up driver registration & lookup qapi: Drop superfluous qapi_enum_parse() parameter max qapi: Update qapi-code-gen.txt examples to match current code qapi-schema: Improve section headings qapi-schema: Move queries from common.json to qapi-schema.json qapi-schema: Make block-core.json self-contained qapi-schema: Fold event.json back into qapi-schema.json ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/qom/object.c b/qom/object.c
index fe6e744b4d..3e18537e9b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1246,7 +1246,7 @@ uint64_t object_property_get_uint(Object *obj, const char *name,
}
typedef struct EnumProperty {
- const char * const *strings;
+ const QEnumLookup *lookup;
int (*get)(Object *, Error **);
void (*set)(Object *, int, Error **);
} EnumProperty;
@@ -1284,7 +1284,7 @@ int object_property_get_enum(Object *obj, const char *name,
visit_complete(v, &str);
visit_free(v);
v = string_input_visitor_new(str);
- visit_type_enum(v, name, &ret, enumprop->strings, errp);
+ visit_type_enum(v, name, &ret, enumprop->lookup, errp);
g_free(str);
visit_free(v);
@@ -1950,7 +1950,7 @@ static void property_get_enum(Object *obj, Visitor *v, const char *name,
return;
}
- visit_type_enum(v, name, &value, prop->strings, errp);
+ visit_type_enum(v, name, &value, prop->lookup, errp);
}
static void property_set_enum(Object *obj, Visitor *v, const char *name,
@@ -1960,7 +1960,7 @@ static void property_set_enum(Object *obj, Visitor *v, const char *name,
int value;
Error *err = NULL;
- visit_type_enum(v, name, &value, prop->strings, &err);
+ visit_type_enum(v, name, &value, prop->lookup, &err);
if (err) {
error_propagate(errp, err);
return;
@@ -1977,7 +1977,7 @@ static void property_release_enum(Object *obj, const char *name,
void object_property_add_enum(Object *obj, const char *name,
const char *typename,
- const char * const *strings,
+ const QEnumLookup *lookup,
int (*get)(Object *, Error **),
void (*set)(Object *, int, Error **),
Error **errp)
@@ -1985,7 +1985,7 @@ void object_property_add_enum(Object *obj, const char *name,
Error *local_err = NULL;
EnumProperty *prop = g_malloc(sizeof(*prop));
- prop->strings = strings;
+ prop->lookup = lookup;
prop->get = get;
prop->set = set;
@@ -2002,7 +2002,7 @@ void object_property_add_enum(Object *obj, const char *name,
void object_class_property_add_enum(ObjectClass *klass, const char *name,
const char *typename,
- const char * const *strings,
+ const QEnumLookup *lookup,
int (*get)(Object *, Error **),
void (*set)(Object *, int, Error **),
Error **errp)
@@ -2010,7 +2010,7 @@ void object_class_property_add_enum(ObjectClass *klass, const char *name,
Error *local_err = NULL;
EnumProperty *prop = g_malloc(sizeof(*prop));
- prop->strings = strings;
+ prop->lookup = lookup;
prop->get = get;
prop->set = set;