From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNMua-0006gG-WE for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:44:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNMuU-00043r-Sc for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:44:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNMuU-00043L-LO for qemu-devel@nongnu.org; Mon, 16 Feb 2015 09:44:30 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1GEiTb5031388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 16 Feb 2015 09:44:29 -0500 From: Markus Armbruster Date: Mon, 16 Feb 2015 15:44:17 +0100 Message-Id: <1424097865-3973-6-git-send-email-armbru@redhat.com> In-Reply-To: <1424097865-3973-1-git-send-email-armbru@redhat.com> References: <1424097865-3973-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 05/13] block: Suppress unhelpful extra errors in bdrv_img_create() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, kraxel@redhat.com, stefanha@redhat.com 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 --- block.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index be28845..09352cb 100644 --- a/block.c +++ b/block.c @@ -5657,7 +5657,9 @@ 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; @@ -5665,7 +5667,8 @@ void bdrv_img_create(const char *filename, const char *fmt, } 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; -- 1.9.3