vpc.c (92adf9dbcd3cf9cedddae995b04a99f5c42ae08c) vpc.c (af91062ee1408f7f5bb58389d355d29a5040c648)
1/*
2 * Block driver for Connectix / Microsoft Virtual PC images
3 *
4 * Copyright (c) 2005 Alex Beregszaszi
5 * Copyright (c) 2009 Kevin Wolf <kwolf@suse.de>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

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

1077 return ret;
1078}
1079
1080static int coroutine_fn vpc_co_create_opts(const char *filename,
1081 QemuOpts *opts, Error **errp)
1082{
1083 BlockdevCreateOptions *create_options = NULL;
1084 QDict *qdict;
1/*
2 * Block driver for Connectix / Microsoft Virtual PC images
3 *
4 * Copyright (c) 2005 Alex Beregszaszi
5 * Copyright (c) 2009 Kevin Wolf <kwolf@suse.de>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

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

1077 return ret;
1078}
1079
1080static int coroutine_fn vpc_co_create_opts(const char *filename,
1081 QemuOpts *opts, Error **errp)
1082{
1083 BlockdevCreateOptions *create_options = NULL;
1084 QDict *qdict;
1085 QObject *qobj;
1086 Visitor *v;
1087 BlockDriverState *bs = NULL;
1088 Error *local_err = NULL;
1089 int ret;
1090
1091 static const QDictRenames opt_renames[] = {
1092 { VPC_OPT_FORCE_SIZE, "force-size" },
1093 { NULL, NULL },

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

1114 ret = -EIO;
1115 goto fail;
1116 }
1117
1118 /* Now get the QAPI type BlockdevCreateOptions */
1119 qdict_put_str(qdict, "driver", "vpc");
1120 qdict_put_str(qdict, "file", bs->node_name);
1121
1085 Visitor *v;
1086 BlockDriverState *bs = NULL;
1087 Error *local_err = NULL;
1088 int ret;
1089
1090 static const QDictRenames opt_renames[] = {
1091 { VPC_OPT_FORCE_SIZE, "force-size" },
1092 { NULL, NULL },

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

1113 ret = -EIO;
1114 goto fail;
1115 }
1116
1117 /* Now get the QAPI type BlockdevCreateOptions */
1118 qdict_put_str(qdict, "driver", "vpc");
1119 qdict_put_str(qdict, "file", bs->node_name);
1120
1122 qobj = qdict_crumple_for_keyval_qiv(qdict, errp);
1123 if (!qobj) {
1121 v = qobject_input_visitor_new_flat_confused(qdict, errp);
1122 if (!v) {
1124 ret = -EINVAL;
1125 goto fail;
1126 }
1127
1123 ret = -EINVAL;
1124 goto fail;
1125 }
1126
1128 v = qobject_input_visitor_new_keyval(qobj);
1129 qobject_unref(qobj);
1130 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
1131 visit_free(v);
1132
1133 if (local_err) {
1134 error_propagate(errp, local_err);
1135 ret = -EINVAL;
1136 goto fail;
1137 }

--- 108 unchanged lines hidden ---
1127 visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
1128 visit_free(v);
1129
1130 if (local_err) {
1131 error_propagate(errp, local_err);
1132 ret = -EINVAL;
1133 goto fail;
1134 }

--- 108 unchanged lines hidden ---