From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOUzn-000299-Js for qemu-devel@nongnu.org; Wed, 17 Oct 2012 10:53:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOUzh-0007qu-Mb for qemu-devel@nongnu.org; Wed, 17 Oct 2012 10:53:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOUzh-0007qq-Ee for qemu-devel@nongnu.org; Wed, 17 Oct 2012 10:53:13 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HErCYG009850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Oct 2012 10:53:12 -0400 Message-ID: <507EC656.4070702@redhat.com> Date: Wed, 17 Oct 2012 16:53:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1349877786-23514-1-git-send-email-pbonzini@redhat.com> <1349877786-23514-12-git-send-email-pbonzini@redhat.com> <87vce9xicb.fsf@blackfin.pond.sub.org> In-Reply-To: <87vce9xicb.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/25] nbd: ask and print error information from qemu-sockets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Il 17/10/2012 16:51, Markus Armbruster ha scritto: >> > /* Basic flow for negotiation > The boilerplate pattern > > Error *local_err = NULL; > FOO(..., *local_err); > if (local_err) { > qerror_report_err(local_err); > error_free(local_err); > } > > is spreading. Not quite sure it's worth a macro. Actually this should not spread, but this one should: Error *local_err = NULL; FOO(..., *local_err); if (local_err) { error_propagate(errp, local_err); return; } Not quite sure how to macroize it though, at least without making the code too ugly to see. Paolo