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>
This commit is contained in:
Markus Armbruster 2020-04-24 10:43:36 +02:00
parent 1f5842487a
commit ea097dff0f
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}