From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQeDz-0001SW-Np for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQeDy-0006jH-Dm for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:41:07 -0400 Received: from mail-qc0-x234.google.com ([2607:f8b0:400d:c01::234]:41318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQeDy-0006jB-8f for qemu-devel@nongnu.org; Fri, 12 Apr 2013 09:41:06 -0400 Received: by mail-qc0-f180.google.com with SMTP id b40so1190990qcq.39 for ; Fri, 12 Apr 2013 06:41:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <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> <20130412122208.GE3426@dhcp-200-207.str.redhat.com> Date: Fri, 12 Apr 2013 15:41:05 +0200 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [RFC 00/13] aio: drop io_flush() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Anthony Liguori , Liu Ping Fan , qemu-devel , Stefan Hajnoczi On Fri, Apr 12, 2013 at 2:22 PM, Kevin Wolf wrote: > 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. Fair enough, that approach does make it possible to drain single devices in the future. Stefan