From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuajP-0003qy-UO for qemu-devel@nongnu.org; Tue, 19 May 2015 02:10:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuajK-0005Bf-UK for qemu-devel@nongnu.org; Tue, 19 May 2015 02:10:23 -0400 Date: Tue, 19 May 2015 11:39:23 +0530 From: Amit Shah Message-ID: <20150519060923.GA29588@grmbl.mre> References: <1432032670-15124-1-git-send-email-famz@redhat.com> <1432032670-15124-3-git-send-email-famz@redhat.com> <20150519060256.GG15452@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519060256.GG15452@grmbl.mre> Subject: Re: [Qemu-devel] [PATCH v3 02/13] qemu-nbd: Switch to qemu_set_fd_handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, Juan Quintela , Jason Wang , qemu-devel@nongnu.org, Vincenzo Maffione , "Vassili Karpov (malc)" , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Giuseppe Lettieri , Luigi Rizzo On (Tue) 19 May 2015 [11:32:56], Amit Shah wrote: > On (Tue) 19 May 2015 [10:50:59], Fam Zheng wrote: > > Achieved by: > > > > - Remembering the server fd with a global variable, in order to access > > it from nbd_client_closed. > > > > - Checking nbd_can_accept() and updating server_fd handler whenever > > client connects or disconnects. > > > > Signed-off-by: Fam Zheng > > Reviewed-by: Paolo Bonzini > > (snip) > > > +static void nbd_update_server_fd_handler(int fd) > > +{ > > + if (nbd_can_accept()) { > > + qemu_set_fd_handler(fd, nbd_accept, NULL, (void *)(uintptr_t)fd); > > + } else { > > + qemu_set_fd_handler(fd, NULL, NULL, NULL); > > The previous patch just introduces a stub for qemu_set_fd_handler(), > so this functionality will break (during bisect) -- can you modify > patch 1 so that things keep working (even by just copying over > qemu_set_fd_handler2() to qemu_set_fd_handler(), and then re-working > that function later? > > Or, it may even be possible to rename the function in patch 1, and > then modify it later. Depends on the flow of the following patches, > but one of these approaches looks better to me. Please ignore! I didn't notice the first patch was to stubs, not iohandler. Amit