From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIJRf-0007Uv-Fm for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIJRd-0002FQ-QX for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:52:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIJRd-0002FI-G4 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:52:45 -0400 Date: Wed, 20 Mar 2013 09:52:43 -0400 From: Luiz Capitulino Message-ID: <20130320095243.0d141253@doriath> In-Reply-To: <20130320133758.GI3074@dhcp-200-207.str.redhat.com> References: <1362566886-14073-1-git-send-email-kwolf@redhat.com> <513722BD.6010503@redhat.com> <20130306111126.GA2285@dhcp-200-207.str.redhat.com> <513756D5.1020506@redhat.com> <20130319163451.205bc2cd@doriath> <20130320083934.GA3074@dhcp-200-207.str.redhat.com> <20130320085712.4983f384@doriath> <20130320133758.GI3074@dhcp-200-207.str.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: Fix assertion failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , aliguori@us.ibm.com, Laszlo Ersek , qemu-devel@nongnu.org On Wed, 20 Mar 2013 14:37:59 +0100 Kevin Wolf wrote: > Am 20.03.2013 um 13:57 hat Luiz Capitulino geschrieben: > > On Wed, 20 Mar 2013 09:39:34 +0100 > > Kevin Wolf wrote: > > > > > Am 19.03.2013 um 21:34 hat Luiz Capitulino geschrieben: > > > > inet_connect_addr() has two users: inet_connect_opts() and wait_for_connect(), > > > > with this patch both of them are now ignoring errors from inet_connect_addr(). > > > > > > > > Suggested solution: refactor inet_connect_addr() to return an errno value. > > > > Callers use error_set() when they want to report an error upward. > > > > > > Doesn't change the problem that you need to know when to set a return > > > value != 0. So it doesn't help, but you'd lose some error information. > > > > My real point is that it's easier to check against errno to find out > > the error cause (compared to using Error for that). > > You mean if the caller has to distinguish between different error codes? Yes. > I think I would agree that avoiding Error can be a good way then if it > doesn't lose error information. If we would lose information, using > error classes other than generic would be acceptable, right? Yes, I think so. I mean, even to me it's not entirely clear when new classes should be added. The rule I had in mind was that a new class should be added when a QMP client needs to distinguish a specific error. However, we're considering QEMU subsystems to be QMP clients, which (taken to an extreme) would lead us to our recent past where Error was trying to replace errno. Markus once wrote about where to set boundaries between errno and Error, but I don't remember if it was a private discussion or an email to the list. It's time to write this down in docs/.