qed.c (92adf9dbcd3cf9cedddae995b04a99f5c42ae08c) qed.c (af91062ee1408f7f5bb58389d355d29a5040c648)
1/*
2 * QEMU Enhanced Disk Format
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 709 unchanged lines hidden (view full) ---

718}
719
720static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
721 QemuOpts *opts,
722 Error **errp)
723{
724 BlockdevCreateOptions *create_options = NULL;
725 QDict *qdict;
1/*
2 * QEMU Enhanced Disk Format
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
8 * Anthony Liguori <aliguori@us.ibm.com>

--- 709 unchanged lines hidden (view full) ---

718}
719
720static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
721 QemuOpts *opts,
722 Error **errp)
723{
724 BlockdevCreateOptions *create_options = NULL;
725 QDict *qdict;
726 QObject *qobj;
727 Visitor *v;
728 BlockDriverState *bs = NULL;
729 Error *local_err = NULL;
730 int ret;
731
732 static const QDictRenames opt_renames[] = {
733 { BLOCK_OPT_BACKING_FILE, "backing-file" },
734 { BLOCK_OPT_BACKING_FMT, "backing-fmt" },

--- 23 unchanged lines hidden (view full) ---

758 ret = -EIO;
759 goto fail;
760 }
761
762 /* Now get the QAPI type BlockdevCreateOptions */
763 qdict_put_str(qdict, "driver", "qed");
764 qdict_put_str(qdict, "file", bs->node_name);
765
726 Visitor *v;
727 BlockDriverState *bs = NULL;
728 Error *local_err = NULL;
729 int ret;
730
731 static const QDictRenames opt_renames[] = {
732 { BLOCK_OPT_BACKING_FILE, "backing-file" },
733 { BLOCK_OPT_BACKING_FMT, "backing-fmt" },

--- 23 unchanged lines hidden (view full) ---

757 ret = -EIO;
758 goto fail;
759 }
760
761 /* Now get the QAPI type BlockdevCreateOptions */
762 qdict_put_str(qdict, "driver", "qed");
763 qdict_put_str(qdict, "file", bs->node_name);
764
766 qobj = qdict_crumple_for_keyval_qiv(qdict, errp);
767 if (!qobj) {
765 v = qobject_input_visitor_new_flat_confused(qdict, errp);
766 if (!v) {
768 ret = -EINVAL;
769 goto fail;
770 }
771
767 ret = -EINVAL;
768 goto fail;
769 }
770
772 v = qobject_input_visitor_new_keyval(qobj);
773 qobject_unref(qobj);
774 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
775 visit_free(v);
776
777 if (local_err) {
778 error_propagate(errp, local_err);
779 ret = -EINVAL;
780 goto fail;
781 }

--- 920 unchanged lines hidden ---
771 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
772 visit_free(v);
773
774 if (local_err) {
775 error_propagate(errp, local_err);
776 ret = -EINVAL;
777 goto fail;
778 }

--- 920 unchanged lines hidden ---