From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLdam-0001Tv-8r for qemu-devel@nongnu.org; Tue, 09 Oct 2012 13:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLdaf-0001mg-FO for qemu-devel@nongnu.org; Tue, 09 Oct 2012 13:27:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLdaf-0001ln-6d for qemu-devel@nongnu.org; Tue, 09 Oct 2012 13:27:33 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q99HRW9H024327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Oct 2012 13:27:32 -0400 Date: Tue, 9 Oct 2012 14:28:26 -0300 From: Luiz Capitulino Message-ID: <20121009142826.1dd5c710@doriath.home> In-Reply-To: <50743C6A.9070206@redhat.com> References: <1349275025-5093-1-git-send-email-pbonzini@redhat.com> <1349275025-5093-16-git-send-email-pbonzini@redhat.com> <20121009115827.486356cb@doriath.home> <50743C6A.9070206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 15/18] qemu-sockets: add error propagation to inet_connect_addr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Tue, 09 Oct 2012 17:02:02 +0200 Paolo Bonzini wrote: > Il 09/10/2012 16:58, Luiz Capitulino ha scritto: > >> > + error_set_errno(errp, errno, QERR_SOCKET_CONNECT_FAILED); > > The patch look fine, but as I said in my previous email I really dislike > > seeing QERR_ macros usage in new code. If the problem here is to duplicate > > the error message, then maybe we could put this connect() block in a wrapper. > > Again: one thing at a time. Right. > The only obvious step is to remove QERR_ constants that are used just > once. I agree. > Everything else should be done carefully because if later you > decide to add something to the errors (for example the bind or connect > argument) you have no protection against typos, etc. I don't fully agree. The best way to do this is to add new wrappers to bind() or connect() that take an Error ** argument and not extend the QERR_ macros. But I agree that we can do this later. > Adding new QERR_ constants is somewhat harmful, but using the old ones > absolutely is not. Yes: Reviewed-by: Luiz Capitulino