diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-06-14 21:14:33 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-06-15 14:49:44 +0200 |
commit | af91062ee1408f7f5bb58389d355d29a5040c648 (patch) | |
tree | cf745cb42a9189cef01e0a14d1d8543e123de892 /block/nbd.c | |
parent | 92adf9dbcd3cf9cedddae995b04a99f5c42ae08c (diff) | |
download | qemu-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/nbd.c')
-rw-r--r-- | block/nbd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/block/nbd.c b/block/nbd.c index 614dd9f..13db403 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -263,7 +263,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, { SocketAddress *saddr = NULL; QDict *addr = NULL; - QObject *crumpled_addr = NULL; Visitor *iv = NULL; Error *local_err = NULL; @@ -273,12 +272,11 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, goto done; } - crumpled_addr = qdict_crumple_for_keyval_qiv(addr, errp); - if (!crumpled_addr) { + iv = qobject_input_visitor_new_flat_confused(addr, errp); + if (!iv) { goto done; } - iv = qobject_input_visitor_new_keyval(crumpled_addr); visit_type_SocketAddress(iv, NULL, &saddr, &local_err); if (local_err) { error_propagate(errp, local_err); @@ -287,7 +285,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, done: qobject_unref(addr); - qobject_unref(crumpled_addr); visit_free(iv); return saddr; } |