From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEZqF-0006zt-19 for qemu-devel@nongnu.org; Thu, 20 Sep 2012 02:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEZqE-00009D-4i for qemu-devel@nongnu.org; Thu, 20 Sep 2012 02:02:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEZqD-000091-Ss for qemu-devel@nongnu.org; Thu, 20 Sep 2012 02:02:26 -0400 Date: Thu, 20 Sep 2012 09:03:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20120920060354.GC5721@redhat.com> References: <1347562697-15411-1-git-send-email-owasserm@redhat.com> <1347562697-15411-4-git-send-email-owasserm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1347562697-15411-4-git-send-email-owasserm@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 3/3] Fix address handling in inet_nonblocking_connect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: kwolf@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, quintela@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, akong@redhat.com > @@ -526,16 +592,19 @@ int inet_connect(const char *str, Error **errp) > return sock; > } > > - > -int inet_nonblocking_connect(const char *str, bool *in_progress, > - Error **errp) > +int inet_nonblocking_connect(const char *str, ConnectHandler *callback, > + void *opaque, bool *in_progress, Error **errp) > { Would be nice to have some documentation here. Something like "on immediate success or immediate failure, in_progress is set to false, in that case callback is not invoked". If you look at it this way, this API is hard to use right. I'd like to suggest we get rid of in_progress flag: return -1 on error and return >=0 and invoke callback on immediate success. -- MST