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>
This commit is contained in:
parent
9b37525a7d
commit
a930091189
14
qemu-img.c
14
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)
|
static int img_create(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c, ret = 0;
|
int c;
|
||||||
uint64_t img_size = -1;
|
uint64_t img_size = -1;
|
||||||
const char *fmt = "raw";
|
const char *fmt = "raw";
|
||||||
const char *base_fmt = NULL;
|
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 "
|
error_report("Invalid image size specified! You may use k, M, G or "
|
||||||
"T suffixes for ");
|
"T suffixes for ");
|
||||||
error_report("kilobytes, megabytes, gigabytes and terabytes.");
|
error_report("kilobytes, megabytes, gigabytes and terabytes.");
|
||||||
ret = -1;
|
return 1;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
img_size = (uint64_t)sval;
|
img_size = (uint64_t)sval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options && is_help_option(options)) {
|
if (options && is_help_option(options)) {
|
||||||
ret = print_block_option_help(filename, fmt);
|
return print_block_option_help(filename, fmt);
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bdrv_img_create(filename, fmt, base_filename, base_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)) {
|
if (error_is_set(&local_err)) {
|
||||||
error_report("%s", error_get_pretty(local_err));
|
error_report("%s", error_get_pretty(local_err));
|
||||||
error_free(local_err);
|
error_free(local_err);
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
if (ret) {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user