From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUknP-000510-2x for qemu-devel@nongnu.org; Tue, 12 Jan 2010 12:44:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUknK-0004z7-VF for qemu-devel@nongnu.org; Tue, 12 Jan 2010 12:44:46 -0500 Received: from [199.232.76.173] (port=59256 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUknJ-0004yw-F9 for qemu-devel@nongnu.org; Tue, 12 Jan 2010 12:44:41 -0500 Received: from verein.lst.de ([213.95.11.210]:51400) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1NUknI-0004CR-Ik for qemu-devel@nongnu.org; Tue, 12 Jan 2010 12:44:41 -0500 Date: Tue, 12 Jan 2010 18:44:38 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 1/2] block: flush backing_hd in the right place Message-ID: <20100112174438.GA733@lst.de> References: <20100112124923.GA19631@lst.de> <4B4CB47C.7090206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B4CB47C.7090206@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Christoph Hellwig , qemu-devel@nongnu.org On Tue, Jan 12, 2010 at 06:42:20PM +0100, Kevin Wolf wrote: > > @@ -623,6 +623,12 @@ int bdrv_commit(BlockDriverState *bs) > > if (drv->bdrv_make_empty) > > return drv->bdrv_make_empty(bs); > > > > + /* > > + * Make sure all data we wrote to the backing device is actually > > + * stable on disk. > > + */ > > + if (bs->backing_hd) > > + bdrv_flush(bs->backing_hd); > > return 0; > > } > > Format drivers with a bdrv_make_empty return before the flush, so it > won't work for qcow1. Looks good otherwise. Oh, okay. > If it has done a bdrv_make_empty we might also want to flush bs? Indeed. I'll spin a new version.