From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQczf-0007nO-V4 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 08:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQcze-0003Ug-M1 for qemu-devel@nongnu.org; Fri, 12 Apr 2013 08:22:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQcze-0003UY-Cu for qemu-devel@nongnu.org; Fri, 12 Apr 2013 08:22:14 -0400 Date: Fri, 12 Apr 2013 14:22:08 +0200 From: Kevin Wolf Message-ID: <20130412122208.GE3426@dhcp-200-207.str.redhat.com> References: <1365695085-27970-1-git-send-email-stefanha@redhat.com> <20130412080202.GB3426@dhcp-200-207.str.redhat.com> <20130412094936.GA4458@stefanha-thinkpad.redhat.com> <20130412100401.GD3426@dhcp-200-207.str.redhat.com> <5167E179.4030202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC 00/13] aio: drop io_flush() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Anthony Liguori , Liu Ping Fan , qemu-devel , Stefan Hajnoczi Am 12.04.2013 um 14:06 hat Stefan Hajnoczi geschrieben: > On Fri, Apr 12, 2013 at 12:27 PM, Paolo Bonzini wrote: > > Il 12/04/2013 12:04, Kevin Wolf ha scritto: > >> Or actually, if you want to avoid .bdrv_drain for now, the patch that I > >> started when I thought a bit about this, had a default .bdrv_drain > >> implementation that just forwarded the request to bs->file if it wasn't > >> implemented by a block driver. For the QED case, this would work. > > > > It's similar to bdrv_co_flush. Drain bs first, then bs->backing_hd > > (this is not needed in bdrv_co_flush), then bs->file, then the driver > > can do it on other files. > > Thanks for explaining Kevin. I didn't check whether bdrv_states > included all BlockDriverStates. > > The simplest solution is to put all BlockDriverStates on a global list. > > A .bdrv_drain() interface is more flexible but I don't see a need for it yet. We don't need the .bdrv_drain() callback yet, but please implement it without a global list and with a function that forwards requests to bs->file and bs->backing_hd like Paolo suggested. This will be the obvious place to add the .bdrv_drain() callback later. The reason why I prefer this approach is that it allows draining a single BlockDriverState. After your patches we're really close to enabling this and converting some bdrv_drain_all() to more specific bdrv_drain(bs) calls. Kevin