mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
92adf9dbcd
commit
af91062ee1
13 changed files with 53 additions and 62 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue