aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-11-30 10:52:06 -0200
committerKevin Wolf <kwolf@redhat.com>2012-12-11 11:05:10 +0100
commita930091189cedcc0023dd38f705e2a46e530f4a4 (patch)
tree4aa837372f26a6d84df68c29f7667fc4145b75ac
parent9b37525a7dbc4f5eef0023fc92716259a3d94612 (diff)
qemu-img: img_create(): drop unneeded goto and ret variable
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--qemu-img.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 595b6f5136..c4dae88e84 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;
}