From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeAoI-0000Rg-4m for qemu-devel@nongnu.org; Fri, 12 Sep 2008 11:43:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeAoG-0000RQ-QM for qemu-devel@nongnu.org; Fri, 12 Sep 2008 11:43:48 -0400 Received: from [199.232.76.173] (port=57566 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeAoG-0000RN-Kx for qemu-devel@nongnu.org; Fri, 12 Sep 2008 11:43:48 -0400 Received: from yx-out-1718.google.com ([74.125.44.152]:17143) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KeAoG-00050o-Jj for qemu-devel@nongnu.org; Fri, 12 Sep 2008 11:43:48 -0400 Received: by yx-out-1718.google.com with SMTP id 3so331060yxi.82 for ; Fri, 12 Sep 2008 08:43:47 -0700 (PDT) Message-ID: Date: Fri, 12 Sep 2008 18:43:46 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH 3/10] Add bdrv_flush_all() In-Reply-To: <1220989802-13706-4-git-send-email-aliguori@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1220989802-13706-1-git-send-email-aliguori@us.ibm.com> <1220989802-13706-4-git-send-email-aliguori@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Chris Wright , Uri Lublin , Anthony Liguori , kvm@vger.kernel.org On 9/9/08, Anthony Liguori wrote: > This patch adds a bdrv_flush_all() function. It's necessary to ensure that all > IO operations have been flushed to disk before completely a live migration. > > N.B. we don't actually use this now. We really should flush the block drivers > using an live savevm callback to avoid unnecessary guest down time. > > Signed-off-by: Anthony Liguori > > diff --git a/block.c b/block.c > index 544176f..921d382 100644 > --- a/block.c > +++ b/block.c > @@ -884,6 +884,21 @@ void bdrv_flush(BlockDriverState *bs) > bdrv_flush(bs->backing_hd); > } > > +void bdrv_iterate_writeable(void (*it)(BlockDriverState *bs)) Forgot "static"? > +{ > + BlockDriverState *bs; > + > + for (bs = bdrv_first; bs != NULL; bs = bs->next) > + if (bs->drv && !bdrv_is_read_only(bs) && > + (!bdrv_is_removable(bs) || bdrv_is_inserted(bs))) > + it(bs); > +}