From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC9VI-0004Ba-Af for qemu-devel@nongnu.org; Thu, 13 Sep 2012 09:30:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC9VD-000534-BN for qemu-devel@nongnu.org; Thu, 13 Sep 2012 09:30:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC9VD-000530-1i for qemu-devel@nongnu.org; Thu, 13 Sep 2012 09:30:43 -0400 Date: Thu, 13 Sep 2012 16:32:07 +0300 From: "Michael S. Tsirkin" Message-ID: <20120913133207.GC7916@redhat.com> References: <1347448378-23915-1-git-send-email-owasserm@redhat.com> <1347448378-23915-4-git-send-email-owasserm@redhat.com> <87har2f46n.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87har2f46n.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v2 3/3] Fix address handling in inet_nonblocking_connect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, aliguori@us.ibm.com, akong@redhat.com, quintela@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, Orit Wasserman , pbonzini@redhat.com, lcapitulino@redhat.com On Thu, Sep 13, 2012 at 03:22:24PM +0200, Markus Armbruster wrote: > > +/* Struct to store connect state for non blocking connect */ > > +typedef struct ConnectState { > > + int fd; > > + struct addrinfo *addr_list; > > + struct addrinfo *current_addr; > > + ConnectHandler *callback; > > + void *opaque; > > + Error *errp; > > +} ConnectState; > > + > > +static ConnectState connect_state = { > > + .fd = -1, > > +}; > > Why does a single connect_state suffice? Even if it does for the specific use, better not to make assumptions about API use. Let's pass connect state to APIs.