vhdx.c (92adf9dbcd3cf9cedddae995b04a99f5c42ae08c) | vhdx.c (af91062ee1408f7f5bb58389d355d29a5040c648) |
---|---|
1/* 2 * Block driver for Hyper-V VHDX Images 3 * 4 * Copyright (c) 2013 Red Hat, Inc., 5 * 6 * Authors: 7 * Jeff Cody <jcody@redhat.com> 8 * --- 1952 unchanged lines hidden (view full) --- 1961} 1962 1963static int coroutine_fn vhdx_co_create_opts(const char *filename, 1964 QemuOpts *opts, 1965 Error **errp) 1966{ 1967 BlockdevCreateOptions *create_options = NULL; 1968 QDict *qdict; | 1/* 2 * Block driver for Hyper-V VHDX Images 3 * 4 * Copyright (c) 2013 Red Hat, Inc., 5 * 6 * Authors: 7 * Jeff Cody <jcody@redhat.com> 8 * --- 1952 unchanged lines hidden (view full) --- 1961} 1962 1963static int coroutine_fn vhdx_co_create_opts(const char *filename, 1964 QemuOpts *opts, 1965 Error **errp) 1966{ 1967 BlockdevCreateOptions *create_options = NULL; 1968 QDict *qdict; |
1969 QObject *qobj; | |
1970 Visitor *v; 1971 BlockDriverState *bs = NULL; 1972 Error *local_err = NULL; 1973 int ret; 1974 1975 static const QDictRenames opt_renames[] = { 1976 { VHDX_BLOCK_OPT_LOG_SIZE, "log-size" }, 1977 { VHDX_BLOCK_OPT_BLOCK_SIZE, "block-size" }, --- 22 unchanged lines hidden (view full) --- 2000 ret = -EIO; 2001 goto fail; 2002 } 2003 2004 /* Now get the QAPI type BlockdevCreateOptions */ 2005 qdict_put_str(qdict, "driver", "vhdx"); 2006 qdict_put_str(qdict, "file", bs->node_name); 2007 | 1969 Visitor *v; 1970 BlockDriverState *bs = NULL; 1971 Error *local_err = NULL; 1972 int ret; 1973 1974 static const QDictRenames opt_renames[] = { 1975 { VHDX_BLOCK_OPT_LOG_SIZE, "log-size" }, 1976 { VHDX_BLOCK_OPT_BLOCK_SIZE, "block-size" }, --- 22 unchanged lines hidden (view full) --- 1999 ret = -EIO; 2000 goto fail; 2001 } 2002 2003 /* Now get the QAPI type BlockdevCreateOptions */ 2004 qdict_put_str(qdict, "driver", "vhdx"); 2005 qdict_put_str(qdict, "file", bs->node_name); 2006 |
2008 qobj = qdict_crumple_for_keyval_qiv(qdict, errp); 2009 if (!qobj) { | 2007 v = qobject_input_visitor_new_flat_confused(qdict, errp); 2008 if (!v) { |
2010 ret = -EINVAL; 2011 goto fail; 2012 } 2013 | 2009 ret = -EINVAL; 2010 goto fail; 2011 } 2012 |
2014 v = qobject_input_visitor_new_keyval(qobj); 2015 qobject_unref(qobj); | |
2016 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err); 2017 visit_free(v); 2018 2019 if (local_err) { 2020 error_propagate(errp, local_err); 2021 ret = -EINVAL; 2022 goto fail; 2023 } --- 119 unchanged lines hidden --- | 2013 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err); 2014 visit_free(v); 2015 2016 if (local_err) { 2017 error_propagate(errp, local_err); 2018 ret = -EINVAL; 2019 goto fail; 2020 } --- 119 unchanged lines hidden --- |