From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44455 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9CzV-0000lq-Nn for Qemu-devel@nongnu.org; Fri, 22 Oct 2010 04:28:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9CzU-0005QU-2y for Qemu-devel@nongnu.org; Fri, 22 Oct 2010 04:28:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9CzT-0005QM-Sg for Qemu-devel@nongnu.org; Fri, 22 Oct 2010 04:28:44 -0400 Message-ID: <4CC14B60.7090900@redhat.com> Date: Fri, 22 Oct 2010 10:29:20 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog References: <4CC04920.8040902@redhat.com> <4CC05744.1060204@codemonkey.ws> <1287689572.2724.0.camel@Quad> In-Reply-To: <1287689572.2724.0.camel@Quad> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Qemu-devel@nongnu.org Am 21.10.2010 21:32, schrieb Laurent Vivier: > Le jeudi 21 octobre 2010 =C3=A0 10:07 -0500, Anthony Liguori a =C3=A9cr= it : >> On 10/21/2010 09:07 AM, Kevin Wolf wrote: >>> Hi all, >>> >>> I'm currently looking into adding a return value to qemu's bdrv_flush >>> function and I noticed that your block drivers (nbd, rbd and sheepdog= ) >>> don't implement bdrv_flush at all. bdrv_flush is going to return >>> -ENOTSUP for any block driver not implementing this, effectively >>> breaking these three drivers for anything but cache=3Dunsafe. >>> >>> Is there a specific reason why your drivers don't implement this? >> >> NBD doesn't have a notion of flush. Only read/write and the block-nbd= =20 >> implementation doesn't do write-caching so flush would be a nop. >> >> I'm not sure what the right semantics would be for QEMU. My guess is = a=20 >> nop flush. >=20 > I agree. Of course, as Laurent said a while ago, there is no specification for NBD, so it's hard to say what the intended semantics is. However, I did have a look at the nbdserver code and it looks as if it implements something similar to writethrough (namely fsync after each write) only if configured this way on the server side. qemu-nbd defaults to writethrough, but can be configured to use cache=3Dnone. So with eithe= r server qemu as a client can't tell whether the data is safe on disk or no= t. In my book this is a strong argument for refusing to open nbd connections with anything but cache=3Dunsafe. Kevin