summaryrefslogtreecommitdiffstats
path: root/qom
diff options
context:
space:
mode:
authorMarkus Armbruster2020-04-24 10:43:36 +0200
committerMarkus Armbruster2020-04-30 07:26:41 +0200
commitea097dff0f011c07202ea7e52a421429e01ef351 (patch)
treebe9458cbfeaf18b551a3a093e0f1496c114ef0bb /qom
parentqapi: Only input visitors can actually fail (diff)
downloadqemu-ea097dff0f011c07202ea7e52a421429e01ef351.tar.gz
qemu-ea097dff0f011c07202ea7e52a421429e01ef351.tar.xz
qemu-ea097dff0f011c07202ea7e52a421429e01ef351.zip
qom: Simplify object_property_get_enum()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200424084338.26803-14-armbru@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/qom/object.c b/qom/object.c
index 1812f79224..be700e831f 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1550,11 +1550,9 @@ 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->lookup, errp);
+ ret = qapi_enum_parse(enumprop->lookup, str, -1, errp);
g_free(str);
- visit_free(v);
return ret;
}