From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52845 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8wkB-0004XB-9O for Qemu-devel@nongnu.org; Thu, 21 Oct 2010 11:07:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8wk9-0000K7-JP for Qemu-devel@nongnu.org; Thu, 21 Oct 2010 11:07:51 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:34407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8wk9-0000K3-CV for Qemu-devel@nongnu.org; Thu, 21 Oct 2010 11:07:49 -0400 Received: by yxi11 with SMTP id 11so2653865yxi.4 for ; Thu, 21 Oct 2010 08:07:48 -0700 (PDT) Message-ID: <4CC05744.1060204@codemonkey.ws> Date: Thu, 21 Oct 2010 10:07:48 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog References: <4CC04920.8040902@redhat.com> In-Reply-To: <4CC04920.8040902@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Qemu-devel@nongnu.org, Christian Brunner , MORITA Kazutaka , Laurent Vivier 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=unsafe. > > 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 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 nop flush. Regards, Anthony Liguori > I > think I remember that one of the drivers always provides > cache=writethough semantics. It would be okay to silently "upgrade" to > cache=writethrough, so in this case I'd just need to add an empty > bdrv_flush implementation. > > Otherwise, we really cannot allow any option except cache=unsafe because > that's the semantics provided by the driver. > > In any case, I think it would be a good idea to implement a real > bdrv_flush function to allow the write-back cache modes cache=off and > cache=writeback in order to improve performance over writethrough. > > Is this possible with your protocols, or can the protocol be changed to > consider this? Any hints on how to proceed? > > Kevin > >