diff mbox series

[v2,13/15] qom: Simplify object_property_get_enum()

Message ID 20200424084338.26803-14-armbru@redhat.com
State Superseded
Headers show
Series qapi: Spring cleaning | expand

Commit Message

Markus Armbruster April 24, 2020, 8:43 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 qom/object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

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