qemu-img.c (53e11bd384a799c03884bd7d8b5be53f025f8e2d) | qemu-img.c (98522f63f40adaebc412481e1d2e9170160d4539) |
---|---|
1/* 2 * QEMU disk image utility 3 * 4 * Copyright (c) 2003-2008 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 --- 260 unchanged lines hidden (view full) --- 269 bool quiet) 270{ 271 BlockDriverState *bs; 272 BlockDriver *drv; 273 char password[256]; 274 Error *local_err = NULL; 275 int ret; 276 | 1/* 2 * QEMU disk image utility 3 * 4 * Copyright (c) 2003-2008 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 --- 260 unchanged lines hidden (view full) --- 269 bool quiet) 270{ 271 BlockDriverState *bs; 272 BlockDriver *drv; 273 char password[256]; 274 Error *local_err = NULL; 275 int ret; 276 |
277 bs = bdrv_new("image"); | 277 bs = bdrv_new("image", &error_abort); |
278 279 if (fmt) { 280 drv = bdrv_find_format(fmt); 281 if (!drv) { 282 error_report("Unknown file format '%s'", fmt); 283 goto fail; 284 } 285 } else { --- 2053 unchanged lines hidden (view full) --- 2339 /* For safe rebasing we need to compare old and new backing file */ 2340 if (unsafe) { 2341 /* Make the compiler happy */ 2342 bs_old_backing = NULL; 2343 bs_new_backing = NULL; 2344 } else { 2345 char backing_name[1024]; 2346 | 278 279 if (fmt) { 280 drv = bdrv_find_format(fmt); 281 if (!drv) { 282 error_report("Unknown file format '%s'", fmt); 283 goto fail; 284 } 285 } else { --- 2053 unchanged lines hidden (view full) --- 2339 /* For safe rebasing we need to compare old and new backing file */ 2340 if (unsafe) { 2341 /* Make the compiler happy */ 2342 bs_old_backing = NULL; 2343 bs_new_backing = NULL; 2344 } else { 2345 char backing_name[1024]; 2346 |
2347 bs_old_backing = bdrv_new("old_backing"); | 2347 bs_old_backing = bdrv_new("old_backing", &error_abort); |
2348 bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name)); 2349 ret = bdrv_open(&bs_old_backing, backing_name, NULL, NULL, BDRV_O_FLAGS, 2350 old_backing_drv, &local_err); 2351 if (ret) { 2352 error_report("Could not open old backing file '%s': %s", 2353 backing_name, error_get_pretty(local_err)); 2354 error_free(local_err); 2355 goto out; 2356 } 2357 if (out_baseimg[0]) { | 2348 bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name)); 2349 ret = bdrv_open(&bs_old_backing, backing_name, NULL, NULL, BDRV_O_FLAGS, 2350 old_backing_drv, &local_err); 2351 if (ret) { 2352 error_report("Could not open old backing file '%s': %s", 2353 backing_name, error_get_pretty(local_err)); 2354 error_free(local_err); 2355 goto out; 2356 } 2357 if (out_baseimg[0]) { |
2358 bs_new_backing = bdrv_new("new_backing"); | 2358 bs_new_backing = bdrv_new("new_backing", &error_abort); |
2359 ret = bdrv_open(&bs_new_backing, out_baseimg, NULL, NULL, 2360 BDRV_O_FLAGS, new_backing_drv, &local_err); 2361 if (ret) { 2362 error_report("Could not open new backing file '%s': %s", 2363 out_baseimg, error_get_pretty(local_err)); 2364 error_free(local_err); 2365 goto out; 2366 } --- 427 unchanged lines hidden --- | 2359 ret = bdrv_open(&bs_new_backing, out_baseimg, NULL, NULL, 2360 BDRV_O_FLAGS, new_backing_drv, &local_err); 2361 if (ret) { 2362 error_report("Could not open new backing file '%s': %s", 2363 out_baseimg, error_get_pretty(local_err)); 2364 error_free(local_err); 2365 goto out; 2366 } --- 427 unchanged lines hidden --- |