summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster2018-10-17 10:27:00 +0200
committerMarkus Armbruster2018-10-19 14:51:34 +0200
commitda7e92cac95fd3b7f91354d2d65b5d59ea36dc13 (patch)
tree521072a503faef35d2d4058f1d08ac96e0fef0e8 /block.c
parentvl: Simplify call of parse_name() (diff)
downloadqemu-da7e92cac95fd3b7f91354d2d65b5d59ea36dc13.tar.gz
qemu-da7e92cac95fd3b7f91354d2d65b5d59ea36dc13.tar.xz
qemu-da7e92cac95fd3b7f91354d2d65b5d59ea36dc13.zip
block: Clean up bdrv_img_create()'s error reporting
bdrv_img_create() takes an Error ** argument and uses it in the conventional way, except for one place: when qemu_opts_do_parse() fails, it first reports its error to stderr or the HMP monitor with error_report_err(), then error_setg()'s a generic error. When the caller reports that second error similarly, this produces two consecutive error messages on stderr or the HMP monitor. When the caller does something else with it, such as send it via QMP, the first error still goes to stderr or the HMP monitor. Fortunately, no such caller exists. Simply use the first error as is. Update expected output of qemu-iotest 049 accordingly. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20181017082702.5581-37-armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/block.c b/block.c
index 5d51419d21..08d64cdc61 100644
--- a/block.c
+++ b/block.c
@@ -4803,9 +4803,6 @@ void bdrv_img_create(const char *filename, const char *fmt,
if (options) {
qemu_opts_do_parse(opts, options, NULL, &local_err);
if (local_err) {
- error_report_err(local_err);
- local_err = NULL;
- error_setg(errp, "Invalid options for file format '%s'", fmt);
goto out;
}
}