From af91062ee1408f7f5bb58389d355d29a5040c648 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 14 Jun 2018 21:14:33 +0200 Subject: block: Factor out qobject_input_visitor_new_flat_confused() Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/rbd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'block/rbd.c') diff --git a/block/rbd.c b/block/rbd.c index 09720e9..82346a2 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -630,7 +630,6 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, BDRVRBDState *s = bs->opaque; BlockdevOptionsRbd *opts = NULL; Visitor *v; - QObject *crumpled = NULL; const QDictEntry *e; Error *local_err = NULL; char *keypairs, *secretid; @@ -647,16 +646,14 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, } /* Convert the remaining options into a QAPI object */ - crumpled = qdict_crumple_for_keyval_qiv(options, errp); - if (crumpled == NULL) { + v = qobject_input_visitor_new_flat_confused(options, errp); + if (!v) { r = -EINVAL; goto out; } - v = qobject_input_visitor_new_keyval(crumpled); visit_type_BlockdevOptionsRbd(v, NULL, &opts, &local_err); visit_free(v); - qobject_unref(crumpled); if (local_err) { error_propagate(errp, local_err); -- cgit v1.1