[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/43] qemu-img: img_create(): drop unneeded goto an
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 15/43] qemu-img: img_create(): drop unneeded goto and ret variable |
Date: |
Thu, 13 Dec 2012 16:10:22 +0100 |
From: Luiz Capitulino <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-img.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 595b6f5..c4dae88 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -294,7 +294,7 @@ static int add_old_style_options(const char *fmt,
QEMUOptionParameter *list,
static int img_create(int argc, char **argv)
{
- int c, ret = 0;
+ int c;
uint64_t img_size = -1;
const char *fmt = "raw";
const char *base_fmt = NULL;
@@ -351,15 +351,13 @@ static int img_create(int argc, char **argv)
error_report("Invalid image size specified! You may use k, M, G or
"
"T suffixes for ");
error_report("kilobytes, megabytes, gigabytes and terabytes.");
- ret = -1;
- goto out;
+ return 1;
}
img_size = (uint64_t)sval;
}
if (options && is_help_option(options)) {
- ret = print_block_option_help(filename, fmt);
- goto out;
+ return print_block_option_help(filename, fmt);
}
bdrv_img_create(filename, fmt, base_filename, base_fmt,
@@ -367,13 +365,9 @@ static int img_create(int argc, char **argv)
if (error_is_set(&local_err)) {
error_report("%s", error_get_pretty(local_err));
error_free(local_err);
- ret = -1;
- }
-
-out:
- if (ret) {
return 1;
}
+
return 0;
}
--
1.7.6.5
- [Qemu-devel] [PATCH 35/43] atapi: reset cdrom tray statuses on ide_reset, (continued)
- [Qemu-devel] [PATCH 35/43] atapi: reset cdrom tray statuses on ide_reset, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 27/43] use qemu_opts_create_nofail, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 43/43] qcow2: Factor out handle_dependencies(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 30/43] blkdebug: Factor out remove_rule(), Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 41/43] qcow2: Enable dirty flag in qcow2_alloc_cluster_link_l2, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 39/43] qcow2: Drop l2meta.cluster_offset, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 31/43] blkdebug: Implement suspend/resume of AIO requests, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 20/43] qemu-io: Implement write -c for compressed clusters, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 26/43] introduce qemu_opts_create_nofail function, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 29/43] blkdebug: Allow usage without config file, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 15/43] qemu-img: img_create(): drop unneeded goto and ret variable,
Kevin Wolf <=
- [Qemu-devel] [PATCH 21/43] rbd: Fix race between aio completition and aio cancel, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 19/43] tests: Add tests for fdsets, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 24/43] qemu-option: qemu_opts_validate(): fix duplicated code, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 42/43] qcow2: Execute run_dependent_requests() without lock, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 38/43] qcow2: Allocate l2meta dynamically, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 40/43] qcow2: Allocate l2meta only for cluster allocations, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 36/43] qcow2: Round QCowL2Meta.offset down to cluster boundary, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 34/43] qemu-iotests: Test concurrent cluster allocations, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 37/43] qcow2: Introduce Qcow2COWRegion, Kevin Wolf, 2012/12/13
- [Qemu-devel] [PATCH 25/43] qemu-option: qemu_opt_set_bool(): fix code duplication, Kevin Wolf, 2012/12/13