From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z57iM-0000wl-48 for qemu-devel@nongnu.org; Wed, 17 Jun 2015 03:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z57iG-0001f2-8y for qemu-devel@nongnu.org; Wed, 17 Jun 2015 03:24:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z57iG-0001eX-3H for qemu-devel@nongnu.org; Wed, 17 Jun 2015 03:24:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 68656374A19 for ; Wed, 17 Jun 2015 07:24:43 +0000 (UTC) Date: Wed, 17 Jun 2015 09:24:40 +0200 From: "Michael S. Tsirkin" Message-ID: <1434525861-21768-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH v2 0/3] error: allow local errors to trigger abort List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, dgilbert@redhat.com It's a common idiom: Error *local_err = NULL; .... foo(&local_err); ... if (local_err) { error_propagate(errp, local_err); return; } Unfortunately it means that call to foo(&local_err) will not abort even if errp is set to error_abort. Instead, we get an abort at error_propagate which is too late, that is, the quality of the stack trace is degraded in that it no longer pinpoints the actual cause of failure. To fix, add an API to check errp and set local_err to error_abort if errp is error_abort. This is out of RFC but I'm still not converting all users: let's merge these patches, then I'll convert all users on top. Changes from v1: Check Error * pointer, not the class, as suggested by Eric. Extend commit log messages with explanation by Eric. Michael S. Tsirkin (3): error: don't rely on pointer comparisons error: allow local errors to trigger abort block/nfs: switch to error_init_local include/qapi/error.h | 5 +++++ block/nfs.c | 2 +- util/error.c | 22 +++++++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) -- MST