rbd.c (e5af0da1dcbfb1a4694150f9954554fb6df88819) | rbd.c (af91062ee1408f7f5bb58389d355d29a5040c648) |
---|---|
1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 616 unchanged lines hidden (view full) --- 625} 626 627static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, 628 Error **errp) 629{ 630 BDRVRBDState *s = bs->opaque; 631 BlockdevOptionsRbd *opts = NULL; 632 Visitor *v; | 1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 616 unchanged lines hidden (view full) --- 625} 626 627static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, 628 Error **errp) 629{ 630 BDRVRBDState *s = bs->opaque; 631 BlockdevOptionsRbd *opts = NULL; 632 Visitor *v; |
633 QObject *crumpled = NULL; | |
634 const QDictEntry *e; 635 Error *local_err = NULL; 636 char *keypairs, *secretid; 637 int r; 638 639 keypairs = g_strdup(qdict_get_try_str(options, "=keyvalue-pairs")); 640 if (keypairs) { 641 qdict_del(options, "=keyvalue-pairs"); 642 } 643 644 secretid = g_strdup(qdict_get_try_str(options, "password-secret")); 645 if (secretid) { 646 qdict_del(options, "password-secret"); 647 } 648 649 /* Convert the remaining options into a QAPI object */ | 633 const QDictEntry *e; 634 Error *local_err = NULL; 635 char *keypairs, *secretid; 636 int r; 637 638 keypairs = g_strdup(qdict_get_try_str(options, "=keyvalue-pairs")); 639 if (keypairs) { 640 qdict_del(options, "=keyvalue-pairs"); 641 } 642 643 secretid = g_strdup(qdict_get_try_str(options, "password-secret")); 644 if (secretid) { 645 qdict_del(options, "password-secret"); 646 } 647 648 /* Convert the remaining options into a QAPI object */ |
650 crumpled = qdict_crumple_for_keyval_qiv(options, errp); 651 if (crumpled == NULL) { | 649 v = qobject_input_visitor_new_flat_confused(options, errp); 650 if (!v) { |
652 r = -EINVAL; 653 goto out; 654 } 655 | 651 r = -EINVAL; 652 goto out; 653 } 654 |
656 v = qobject_input_visitor_new_keyval(crumpled); | |
657 visit_type_BlockdevOptionsRbd(v, NULL, &opts, &local_err); 658 visit_free(v); | 655 visit_type_BlockdevOptionsRbd(v, NULL, &opts, &local_err); 656 visit_free(v); |
659 qobject_unref(crumpled); | |
660 661 if (local_err) { 662 error_propagate(errp, local_err); 663 r = -EINVAL; 664 goto out; 665 } 666 667 /* Remove the processed options from the QDict (the visitor processes --- 522 unchanged lines hidden --- | 657 658 if (local_err) { 659 error_propagate(errp, local_err); 660 r = -EINVAL; 661 goto out; 662 } 663 664 /* Remove the processed options from the QDict (the visitor processes --- 522 unchanged lines hidden --- |