qcow.c (92adf9dbcd3cf9cedddae995b04a99f5c42ae08c) | qcow.c (af91062ee1408f7f5bb58389d355d29a5040c648) |
---|---|
1/* 2 * Block driver for the QCOW format 3 * 4 * Copyright (c) 2004-2006 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 933 unchanged lines hidden (view full) --- 942} 943 944static int coroutine_fn qcow_co_create_opts(const char *filename, 945 QemuOpts *opts, Error **errp) 946{ 947 BlockdevCreateOptions *create_options = NULL; 948 BlockDriverState *bs = NULL; 949 QDict *qdict; | 1/* 2 * Block driver for the QCOW format 3 * 4 * Copyright (c) 2004-2006 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 933 unchanged lines hidden (view full) --- 942} 943 944static int coroutine_fn qcow_co_create_opts(const char *filename, 945 QemuOpts *opts, Error **errp) 946{ 947 BlockdevCreateOptions *create_options = NULL; 948 BlockDriverState *bs = NULL; 949 QDict *qdict; |
950 QObject *qobj; | |
951 Visitor *v; 952 const char *val; 953 Error *local_err = NULL; 954 int ret; 955 956 static const QDictRenames opt_renames[] = { 957 { BLOCK_OPT_BACKING_FILE, "backing-file" }, 958 { BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT }, --- 33 unchanged lines hidden (view full) --- 992 ret = -EIO; 993 goto fail; 994 } 995 996 /* Now get the QAPI type BlockdevCreateOptions */ 997 qdict_put_str(qdict, "driver", "qcow"); 998 qdict_put_str(qdict, "file", bs->node_name); 999 | 950 Visitor *v; 951 const char *val; 952 Error *local_err = NULL; 953 int ret; 954 955 static const QDictRenames opt_renames[] = { 956 { BLOCK_OPT_BACKING_FILE, "backing-file" }, 957 { BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT }, --- 33 unchanged lines hidden (view full) --- 991 ret = -EIO; 992 goto fail; 993 } 994 995 /* Now get the QAPI type BlockdevCreateOptions */ 996 qdict_put_str(qdict, "driver", "qcow"); 997 qdict_put_str(qdict, "file", bs->node_name); 998 |
1000 qobj = qdict_crumple_for_keyval_qiv(qdict, errp); 1001 if (!qobj) { | 999 v = qobject_input_visitor_new_flat_confused(qdict, errp); 1000 if (!v) { |
1002 ret = -EINVAL; 1003 goto fail; 1004 } 1005 | 1001 ret = -EINVAL; 1002 goto fail; 1003 } 1004 |
1006 v = qobject_input_visitor_new_keyval(qobj); 1007 qobject_unref(qobj); | |
1008 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err); 1009 visit_free(v); 1010 1011 if (local_err) { 1012 error_propagate(errp, local_err); 1013 ret = -EINVAL; 1014 goto fail; 1015 } --- 202 unchanged lines hidden --- | 1005 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err); 1006 visit_free(v); 1007 1008 if (local_err) { 1009 error_propagate(errp, local_err); 1010 ret = -EINVAL; 1011 goto fail; 1012 } --- 202 unchanged lines hidden --- |