diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-11-30 10:52:05 -0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-12-11 11:05:10 +0100 |
commit | 9b37525a7dbc4f5eef0023fc92716259a3d94612 (patch) | |
tree | 7c9cfd9e2053f60deee31866c9275ed75dc922e5 /qemu-img.c | |
parent | 71c79813d83b5b45ba934cf995436063da458f66 (diff) |
qemu-img: img_create(): pass Error object to bdrv_img_create()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c index 3896689060..595b6f5136 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -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:"); @@ -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; |