block.c (57348c2f18d2f9f77f4d0ecdc5a83029a933c5d8) | block.c (5577fff73822c91efd827dde33b8513a5e03ee8d) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 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 --- 1248 unchanged lines hidden (view full) --- 1257{ 1258 QObject *options_obj; 1259 QDict *options; 1260 int ret; 1261 1262 ret = strstart(filename, "json:", &filename); 1263 assert(ret); 1264 | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 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 --- 1248 unchanged lines hidden (view full) --- 1257{ 1258 QObject *options_obj; 1259 QDict *options; 1260 int ret; 1261 1262 ret = strstart(filename, "json:", &filename); 1263 assert(ret); 1264 |
1265 options_obj = qobject_from_json(filename, NULL); | 1265 options_obj = qobject_from_json(filename, errp); |
1266 if (!options_obj) { | 1266 if (!options_obj) { |
1267 error_setg(errp, "Could not parse the JSON options"); | 1267 /* Work around qobject_from_json() lossage TODO fix that */ 1268 if (errp && !*errp) { 1269 error_setg(errp, "Could not parse the JSON options"); 1270 return NULL; 1271 } 1272 error_prepend(errp, "Could not parse the JSON options: "); |
1268 return NULL; 1269 } 1270 1271 options = qobject_to_qdict(options_obj); 1272 if (!options) { 1273 qobject_decref(options_obj); 1274 error_setg(errp, "Invalid JSON object given"); 1275 return NULL; --- 3354 unchanged lines hidden --- | 1273 return NULL; 1274 } 1275 1276 options = qobject_to_qdict(options_obj); 1277 if (!options) { 1278 qobject_decref(options_obj); 1279 error_setg(errp, "Invalid JSON object given"); 1280 return NULL; --- 3354 unchanged lines hidden --- |