Skip to content

Commit

Permalink
block: Suppress unhelpful extra errors in bdrv_img_create()
Browse files Browse the repository at this point in the history
bdrv_img_create() uses qemu_opt_set(), which reports errors with
qerror_report_err().  Its error messages aren't helpful here, the
caller reports one that actually makes sense.  I don't know how to
trigger the error conditions, though.

Switch to qemu_opt_set_err() to get rid of the unwanted messages.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
Markus Armbruster committed Feb 26, 2015
1 parent 6750e79 commit 6be4194
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions block.c
Expand Up @@ -5660,15 +5660,18 @@ void bdrv_img_create(const char *filename, const char *fmt,
}

if (base_filename) {
if (qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename)) {
qemu_opt_set_err(opts, BLOCK_OPT_BACKING_FILE, base_filename,
&local_err);
if (local_err) {
error_setg(errp, "Backing file not supported for file format '%s'",
fmt);
goto out;
}
}

if (base_fmt) {
if (qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt)) {
qemu_opt_set_err(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err);
if (local_err) {
error_setg(errp, "Backing file format not supported for file "
"format '%s'", fmt);
goto out;
Expand Down

0 comments on commit 6be4194

Please sign in to comment.