From patchwork Wed Apr 30 18:23:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 344288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D2F2F1400A0 for ; Thu, 1 May 2014 04:39:01 +1000 (EST) Received: from localhost ([::1]:58536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZPH-0002CV-Qd for incoming@patchwork.ozlabs.org; Wed, 30 Apr 2014 14:38:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZBO-0007E9-75 for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfZBH-0003Hs-W1 for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZBH-0003Hn-Oj for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:31 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3UIOUwI019717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 30 Apr 2014 14:24:31 -0400 Received: from noname.redhat.com (ovpn-116-113.ams2.redhat.com [10.36.116.113]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3UIO4ip011903; Wed, 30 Apr 2014 14:24:29 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 30 Apr 2014 20:23:49 +0200 Message-Id: <1398882243-14783-18-git-send-email-kwolf@redhat.com> In-Reply-To: <1398882243-14783-1-git-send-email-kwolf@redhat.com> References: <1398882243-14783-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PULL 17/31] block: Use error_abort in bdrv_image_info_specific_dump() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Max Reitz Currently, bdrv_image_info_specific_dump() uses an error variable for visit_type_ImageInfoSpecific, but ignores the result. As this function is used here with an output visitor to transform the ImageInfoSpecific object to a generic QDict, an error should actually be impossible. It is however better to assert that this is indeed the case. This is done by this patch using error_abort instead of an unused local Error variable. Signed-off-by: Max Reitz Reported-by: Markus Armbruster Signed-off-by: Kevin Wolf --- block/qapi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 8f2b4db..af11445 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -532,12 +532,11 @@ static void dump_qdict(fprintf_function func_fprintf, void *f, int indentation, void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f, ImageInfoSpecific *info_spec) { - Error *local_err = NULL; QmpOutputVisitor *ov = qmp_output_visitor_new(); QObject *obj, *data; visit_type_ImageInfoSpecific(qmp_output_get_visitor(ov), &info_spec, NULL, - &local_err); + &error_abort); obj = qmp_output_get_qobject(ov); assert(qobject_type(obj) == QTYPE_QDICT); data = qdict_get(qobject_to_qdict(obj), "data");