Skip to content

Commit

Permalink
qemu-img: img_create(): pass Error object to bdrv_img_create()
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Luiz Capitulino authored and kevmw committed Dec 11, 2012
1 parent 71c7981 commit 9b37525
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qemu-img.c
Expand Up @@ -301,6 +301,7 @@ static int img_create(int argc, char **argv)
const char *filename;
const char *base_filename = NULL;
char *options = NULL;
Error *local_err = NULL;

for(;;) {
c = getopt(argc, argv, "F:b:f:he6o:");
Expand Down Expand Up @@ -361,8 +362,14 @@ static int img_create(int argc, char **argv)
goto out;
}

ret = bdrv_img_create(filename, fmt, base_filename, base_fmt,
options, img_size, BDRV_O_FLAGS, NULL);
bdrv_img_create(filename, fmt, base_filename, base_fmt,
options, img_size, BDRV_O_FLAGS, &local_err);
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;
Expand Down

0 comments on commit 9b37525

Please sign in to comment.