1 From 6b8ac153620bbc1a39e9ee6eef0392219886ebb3 Mon Sep 17 00:00:00 2001
2 From: Alexandre Derumier <aderumier@odiso.com>
3 Date: Mon, 29 Oct 2012 10:02:33 +0100
4 Subject: [PATCH] skipcreate
7 Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
9 qemu-img.c | 36 +++++++++++++++++++++---------------
10 1 file changed, 21 insertions(+), 15 deletions(-)
12 diff --git a/qemu-img.c b/qemu-img.c
13 index b41e670..d399ccd 100644
16 @@ -654,7 +654,7 @@ static int compare_sectors(const uint8_t *buf1, const uint8_t *buf2, int n,
18 static int img_convert(int argc, char **argv)
20 - int c, ret = 0, n, n1, bs_n, bs_i, compress, cluster_size, cluster_sectors;
21 + int c, ret = 0, n, n1, bs_n, bs_i, compress, cluster_size, cluster_sectors, skipcreate;
22 int progress = 0, flags;
23 const char *fmt, *out_fmt, *cache, *out_baseimg, *out_filename;
24 BlockDriver *drv, *proto_drv;
25 @@ -676,8 +676,9 @@ static int img_convert(int argc, char **argv)
31 - c = getopt(argc, argv, "f:O:B:s:hce6o:pS:t:");
32 + c = getopt(argc, argv, "f:O:B:s:hcCe6o:pS:t:");
36 @@ -698,6 +699,9 @@ static int img_convert(int argc, char **argv)
44 error_report("option -e is deprecated, please use \'-o "
45 "encryption\' instead!");
46 @@ -858,20 +862,22 @@ static int img_convert(int argc, char **argv)
50 - /* Create the new image */
51 - ret = bdrv_create(drv, out_filename, param);
53 - if (ret == -ENOTSUP) {
54 - error_report("Formatting not supported for file format '%s'",
56 - } else if (ret == -EFBIG) {
57 - error_report("The image size is too large for file format '%s'",
60 - error_report("%s: error while converting %s: %s",
61 - out_filename, out_fmt, strerror(-ret));
63 + /* Create the new image */
64 + ret = bdrv_create(drv, out_filename, param);
66 + if (ret == -ENOTSUP) {
67 + error_report("Formatting not supported for file format '%s'",
69 + } else if (ret == -EFBIG) {
70 + error_report("The image size is too large for file format '%s'",
73 + error_report("%s: error while converting %s: %s",
74 + out_filename, out_fmt, strerror(-ret));