Received: from eggs.gnu.org ([2001:4830:134:3::10]:46278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENMO-0000Pq-GC for qemu-devel@nongnu.org; Fri, 14 Feb 2014 13:19:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WENMH-0003F9-PJ for qemu-devel@nongnu.org; Fri, 14 Feb 2014 13:19:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENMH-0003F1-HI for qemu-devel@nongnu.org; Fri, 14 Feb 2014 13:19:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1EIJSk1023840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Feb 2014 13:19:28 -0500 Date: Fri, 14 Feb 2014 19:19:26 +0100 From: Kevin Wolf Message-ID: <20140214181926.GM32343@dhcp-200-207.str.redhat.com> References: <1392138233-26407-1-git-send-email-pbonzini@redhat.com> <1392138233-26407-10-git-send-email-pbonzini@redhat.com> <20140214164540.GK32343@dhcp-200-207.str.redhat.com> <52FE4C12.8050607@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52FE4C12.8050607@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, qemu-devel@nongnu.org Am 14.02.2014 um 18:02 hat Paolo Bonzini geschrieben: > Il 14/02/2014 17:45, Kevin Wolf ha scritto: > >>> - ret = bdrv_file_open(&cow_bs, filename, NULL, NULL, BDRV_O_RDWR, > >>> - &local_err); > >>> + ret = bdrv_file_open(&cow_bs, filename, NULL, NULL, BDRV_O_RDWR, errp); > >>> if (ret < 0) { > >>> - qerror_report_err(local_err); > >>> - error_free(local_err); > >>> return ret; > >>> } > >This is technically correct, but I think general policy is that using > >the local_err pattern is preferred anyway. > > I think only for void-returning functions. I checked callers of > monitor_get_fd and they use this pattern, even if they pass > &local_err instead of errp. Eventually this function will return void; having both a -errno return and the errp argument is just an intermediate step (as probably in all other cases). So I still think this is going in the wrong direction and will make the conversion harder than necessary. Now that this patch series is already here, I won't insist on respinning it, but please be aware that you're just creating additional work for other people and keep existing local_errs in any future patches. Kevin