aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-01-10 13:53:14 +0100
committerEduardo Habkost <ehabkost@redhat.com>2017-01-12 15:34:47 -0200
commit3a4641054e320d8ad7e780c30010b1c1dbfc56e8 (patch)
treeada1ebe9f19ba0cf2f374e46d899b4bdfdc39013 /hmp.c
parent8a000250f15051961fa45c737e661bc19a2978e9 (diff)
monitor: reuse user_creatable_add_opts() instead of user_creatable_add()
Simplify code by dropping ~57LOC by merging user_creatable_add() into user_creatable_add_opts() and using the later from monitor. Along with it allocate opts_visitor_new() once in user_creatable_add_opts(). As result we have one less API func and a more readable/simple user_creatable_add_opts() vs user_creatable_add(). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1484052795-158195-3-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hmp.c b/hmp.c
index b86961705d..e7bead5a1d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1808,7 +1808,6 @@ void hmp_object_add(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
QemuOpts *opts;
- Visitor *v;
Object *obj = NULL;
opts = qemu_opts_from_qdict(qemu_find_opts("object"), qdict, &err);
@@ -1817,9 +1816,7 @@ void hmp_object_add(Monitor *mon, const QDict *qdict)
return;
}
- v = opts_visitor_new(opts);
- obj = user_creatable_add(qdict, v, &err);
- visit_free(v);
+ obj = user_creatable_add_opts(opts, &err);
qemu_opts_del(opts);
if (err) {