From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxBn9-00080P-9m for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxBn6-0006CH-3x for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:45:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxBn5-0006C9-Ss for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:45:43 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0F6280B56 for ; Thu, 20 Oct 2016 11:45:42 +0000 (UTC) From: Markus Armbruster References: <20161019100552.GD2035@work-vm> <20161019101616.GL11194@redhat.com> <87a8e0bkl6.fsf@dusky.pond.sub.org> <20161019122158.GS11194@redhat.com> <20161019180616.GF2035@work-vm> <87oa2fwg9z.fsf@dusky.pond.sub.org> <20161020090356.GD12145@redhat.com> <20161020095835.GC2039@work-vm> <87funrti86.fsf@dusky.pond.sub.org> <20161020110108.GE2039@work-vm> <20161020111052.GH12145@redhat.com> Date: Thu, 20 Oct 2016 13:45:40 +0200 In-Reply-To: <20161020111052.GH12145@redhat.com> (Daniel P. Berrange's message of "Thu, 20 Oct 2016 12:10:52 +0100") Message-ID: <87shrrqm57.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] chardev's and fd's in monitors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: "Dr. David Alan Gilbert" , qemu-devel@nongnu.org "Daniel P. Berrange" writes: > On Thu, Oct 20, 2016 at 12:01:08PM +0100, Dr. David Alan Gilbert wrote: >> * Markus Armbruster (armbru@redhat.com) wrote: >> > "Dr. David Alan Gilbert" writes: >> >> > > The problem is that our way of propagating errors actively discourages >> > > people from adding errors and you're left with lots of useless invented errno's. >> > > error_report makes it easy for people to scatter meaningful error messages >> > > in at any point. >> > > >> > > Make an easy, concise way of reporting an error that fits in with >> > > a propagation scheme and I'd consider converting stuff. >> > >> > error_setg(errp, "This is as simple as it gets, I'm afraid") >> > >> > Snark aside, I acknowledge the pain of converting call chains to >> > propagate Error objects, having converted "a few" myself. >> >> If you can get it down to that line it would be great! >> >> But unfortunately it isn't: >> a) I have to make sure my cleanup path after that error_setg doesn't >> cause any other errors because that breaks the rule >> that I can't call error_setg twice. We disallowed setting a second error because that's a common symptom of forgotten or botched error handling. For what it's worth, g_error_set() does the same. >> b) I've got to put the whole local_err/error_propagate stuff all over. Only when you need to examine the errors you're propagating. >> c) We insist on allowing the Err ** pointer to be NULL that >> removes some potential simplifications. > > This last point is one i really dislike - if we could mandate that > the error parameters was non-NULL, it will eliminate alot of the > need to use local_err/error_propagate, as you could just check > if (*errp), and so largely solve (b). Outlawing null errp shifts the pain to the places that ignore errors. Whether that would be a win is not obvious. A patch doing the change might demonstrate it is, but it would be a lot of work, possibly for naught. For what it's worth, g_error_set() permits null, too.