From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxBFU-0005Ec-Qq for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:11:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxBFQ-0001cF-VV for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:11:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46116) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxBFQ-0001c1-PC for qemu-devel@nongnu.org; Thu, 20 Oct 2016 07:10:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 2240165F54 for ; Thu, 20 Oct 2016 11:10:56 +0000 (UTC) Date: Thu, 20 Oct 2016 12:10:52 +0100 From: "Daniel P. Berrange" Message-ID: <20161020111052.GH12145@redhat.com> Reply-To: "Daniel P. Berrange" 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161020110108.GE2039@work-vm> Subject: Re: [Qemu-devel] chardev's and fd's in monitors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: Markus Armbruster , qemu-devel@nongnu.org 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. > b) I've got to put the whole local_err/error_propagate stuff all over. > > 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). Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|