Revision 34b5d2c6 qemu-img.c

b/qemu-img.c
266 266
    BlockDriverState *bs;
267 267
    BlockDriver *drv;
268 268
    char password[256];
269
    Error *local_err = NULL;
269 270
    int ret;
270 271

  
271 272
    bs = bdrv_new("image");
......
280 281
        drv = NULL;
281 282
    }
282 283

  
283
    ret = bdrv_open(bs, filename, NULL, flags, drv);
284
    ret = bdrv_open(bs, filename, NULL, flags, drv, &local_err);
284 285
    if (ret < 0) {
285
        error_report("Could not open '%s': %s", filename, strerror(-ret));
286
        error_report("Could not open '%s': %s", filename,
287
                     error_get_pretty(local_err));
288
        error_free(local_err);
286 289
        goto fail;
287 290
    }
288 291

  
......
2127 2130
    int unsafe = 0;
2128 2131
    int progress = 0;
2129 2132
    bool quiet = false;
2133
    Error *local_err = NULL;
2130 2134

  
2131 2135
    /* Parse commandline parameters */
2132 2136
    fmt = NULL;
......
2230 2234
        bs_old_backing = bdrv_new("old_backing");
2231 2235
        bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name));
2232 2236
        ret = bdrv_open(bs_old_backing, backing_name, NULL, BDRV_O_FLAGS,
2233
                        old_backing_drv);
2237
                        old_backing_drv, &local_err);
2234 2238
        if (ret) {
2235
            error_report("Could not open old backing file '%s'", backing_name);
2239
            error_report("Could not open old backing file '%s': %s",
2240
                         backing_name, error_get_pretty(local_err));
2241
            error_free(local_err);
2236 2242
            goto out;
2237 2243
        }
2238 2244
        if (out_baseimg[0]) {
2239 2245
            bs_new_backing = bdrv_new("new_backing");
2240 2246
            ret = bdrv_open(bs_new_backing, out_baseimg, NULL, BDRV_O_FLAGS,
2241
                        new_backing_drv);
2247
                        new_backing_drv, &local_err);
2242 2248
            if (ret) {
2243
                error_report("Could not open new backing file '%s'",
2244
                             out_baseimg);
2249
                error_report("Could not open new backing file '%s': %s",
2250
                             out_baseimg, error_get_pretty(local_err));
2251
                error_free(local_err);
2245 2252
                goto out;
2246 2253
            }
2247 2254
        }

Also available in: Unified diff