aboutsummaryrefslogtreecommitdiff
path: root/block/qed.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-06-14 21:14:33 +0200
committerKevin Wolf <kwolf@redhat.com>2018-06-15 14:49:44 +0200
commitaf91062ee1408f7f5bb58389d355d29a5040c648 (patch)
treecf745cb42a9189cef01e0a14d1d8543e123de892 /block/qed.c
parent92adf9dbcd3cf9cedddae995b04a99f5c42ae08c (diff)
downloadqemu-af91062ee1408f7f5bb58389d355d29a5040c648.zip
qemu-af91062ee1408f7f5bb58389d355d29a5040c648.tar.gz
qemu-af91062ee1408f7f5bb58389d355d29a5040c648.tar.bz2
block: Factor out qobject_input_visitor_new_flat_confused()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed.c')
-rw-r--r--block/qed.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/block/qed.c b/block/qed.c
index fcec760..2363814 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -723,7 +723,6 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
{
BlockdevCreateOptions *create_options = NULL;
QDict *qdict;
- QObject *qobj;
Visitor *v;
BlockDriverState *bs = NULL;
Error *local_err = NULL;
@@ -763,14 +762,12 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
qdict_put_str(qdict, "driver", "qed");
qdict_put_str(qdict, "file", bs->node_name);
- qobj = qdict_crumple_for_keyval_qiv(qdict, errp);
- if (!qobj) {
+ v = qobject_input_visitor_new_flat_confused(qdict, errp);
+ if (!v) {
ret = -EINVAL;
goto fail;
}
- v = qobject_input_visitor_new_keyval(qobj);
- qobject_unref(qobj);
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
visit_free(v);