From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwveF-0003Fv-Ns for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwveA-00065G-17 for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:41:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swve9-00064H-Ou for qemu-devel@nongnu.org; Thu, 02 Aug 2012 09:41:01 -0400 Date: Thu, 2 Aug 2012 10:41:35 -0300 From: Luiz Capitulino Message-ID: <20120802104135.546a2758@doriath.home> In-Reply-To: <1343869374-23417-16-git-send-email-lcapitulino@redhat.com> References: <1343869374-23417-1-git-send-email-lcapitulino@redhat.com> <1343869374-23417-16-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 15/34] net: inet_connect(), inet_connect_opts(): return -errno List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, aliguori@us.ibm.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, pbonzini@redhat.com, eblake@redhat.com On Wed, 1 Aug 2012 22:02:35 -0300 Luiz Capitulino wrote: > Next commit wants to use this. > > Signed-off-by: Luiz Capitulino > --- > > This patch is an interesting case, because one of the goal of the error > format that's being replaced was that callers could use it to know the > error cause (with error_is_type(). > > However, the new error format doesn't allow this as most errors are > class GenericError. So, we'll have to use errno to know the error cause, > this is the case of inet_connect() when called by > tcp_start_outgoing_migration(). I'm thinking in doing this differently. Instead of returning errno, we could have: error_sete(Error **err, ErrorClass err_class, int err_no, const char *fmt, ...); Then we store err_no in Error, and also add error_get_errno(). Comments?