From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akuL9-0006m3-Kn for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akuL3-0001ch-I1 for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:09:51 -0400 Date: Tue, 29 Mar 2016 17:09:32 +0300 From: "Michael S. Tsirkin" Message-ID: <20160329170848-mutt-send-email-mst@redhat.com> References: <1459258923-10319-1-git-send-email-mst@redhat.com> <1459258923-10319-3-git-send-email-mst@redhat.com> <56FA8BBA.2070402@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56FA8BBA.2070402@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-blk: use aio handler for data plane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Cornelia Huck , Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org On Tue, Mar 29, 2016 at 04:05:46PM +0200, Paolo Bonzini wrote: > > > On 29/03/2016 15:42, Michael S. Tsirkin wrote: > > + if (s->dataplane) { > > + /* Some guests kick before setting VIRTIO_CONFIG_S_DRIVER_OK so start > > + * dataplane here instead of waiting for .set_status(). > > + */ > > + if (!s->dataplane_started) { > > + virtio_blk_data_plane_start(s->dataplane); > > + } > > + return; > > + } > > + > > + virtio_blk_handle_vq(s, vq); > > Another small comment, this can be written simply as > > if (s->dataplane) { > virtio_blk_data_plane_start(s->dataplane); True, it's best not to poke at dataplane_started. > } else { > virtio_blk_handle_vq(s, vq); > } > I prefer the return style I think, to stress the fact that this is an unusual, unexpected case. > Paolo