qemu-img.c (380f649e02f9545159dc3158d7c1b2e70c1005e3) | qemu-img.c (9aebf3b89281a173d2dfeee379b800be5e3f363e) |
---|---|
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 --- 997 unchanged lines hidden (view full) --- 1006 flags = BDRV_O_FLAGS; 1007 ret = bdrv_parse_cache_flags(cache, &flags); 1008 if (ret < 0) { 1009 error_report("Invalid source cache option: %s", cache); 1010 ret = 2; 1011 goto out3; 1012 } 1013 | 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 --- 997 unchanged lines hidden (view full) --- 1006 flags = BDRV_O_FLAGS; 1007 ret = bdrv_parse_cache_flags(cache, &flags); 1008 if (ret < 0) { 1009 error_report("Invalid source cache option: %s", cache); 1010 ret = 2; 1011 goto out3; 1012 } 1013 |
1014 bs1 = bdrv_new_open("image 1", filename1, fmt1, flags, true, quiet); | 1014 bs1 = bdrv_new_open("image_1", filename1, fmt1, flags, true, quiet); |
1015 if (!bs1) { 1016 error_report("Can't open file %s", filename1); 1017 ret = 2; 1018 goto out3; 1019 } 1020 | 1015 if (!bs1) { 1016 error_report("Can't open file %s", filename1); 1017 ret = 2; 1018 goto out3; 1019 } 1020 |
1021 bs2 = bdrv_new_open("image 2", filename2, fmt2, flags, true, quiet); | 1021 bs2 = bdrv_new_open("image_2", filename2, fmt2, flags, true, quiet); |
1022 if (!bs2) { 1023 error_report("Can't open file %s", filename2); 1024 ret = 2; 1025 goto out2; 1026 } 1027 1028 buf1 = qemu_blockalign(bs1, IO_BUF_SIZE); 1029 buf2 = qemu_blockalign(bs2, IO_BUF_SIZE); --- 324 unchanged lines hidden (view full) --- 1354 1355 qemu_progress_print(0, 100); 1356 1357 bs = g_new0(BlockDriverState *, bs_n); 1358 bs_sectors = g_new(int64_t, bs_n); 1359 1360 total_sectors = 0; 1361 for (bs_i = 0; bs_i < bs_n; bs_i++) { | 1022 if (!bs2) { 1023 error_report("Can't open file %s", filename2); 1024 ret = 2; 1025 goto out2; 1026 } 1027 1028 buf1 = qemu_blockalign(bs1, IO_BUF_SIZE); 1029 buf2 = qemu_blockalign(bs2, IO_BUF_SIZE); --- 324 unchanged lines hidden (view full) --- 1354 1355 qemu_progress_print(0, 100); 1356 1357 bs = g_new0(BlockDriverState *, bs_n); 1358 bs_sectors = g_new(int64_t, bs_n); 1359 1360 total_sectors = 0; 1361 for (bs_i = 0; bs_i < bs_n; bs_i++) { |
1362 char *id = bs_n > 1 ? g_strdup_printf("source %d", bs_i) | 1362 char *id = bs_n > 1 ? g_strdup_printf("source_%d", bs_i) |
1363 : g_strdup("source"); 1364 bs[bs_i] = bdrv_new_open(id, argv[optind + bs_i], fmt, src_flags, 1365 true, quiet); 1366 g_free(id); 1367 if (!bs[bs_i]) { 1368 error_report("Could not open '%s'", argv[optind + bs_i]); 1369 ret = -1; 1370 goto out; --- 1558 unchanged lines hidden --- | 1363 : g_strdup("source"); 1364 bs[bs_i] = bdrv_new_open(id, argv[optind + bs_i], fmt, src_flags, 1365 true, quiet); 1366 g_free(id); 1367 if (!bs[bs_i]) { 1368 error_report("Could not open '%s'", argv[optind + bs_i]); 1369 ret = -1; 1370 goto out; --- 1558 unchanged lines hidden --- |