qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Laurent Vivier <Laurent@vivier.eu>
Cc: Qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog
Date: Fri, 22 Oct 2010 10:29:20 +0200	[thread overview]
Message-ID: <4CC14B60.7090900@redhat.com> (raw)
In-Reply-To: <1287689572.2724.0.camel@Quad>

Am 21.10.2010 21:32, schrieb Laurent Vivier:
> Le jeudi 21 octobre 2010 à 10:07 -0500, Anthony Liguori a écrit :
>> 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.
> 
> 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=none. So with either
server qemu as a client can't tell whether the data is safe on disk or not.

In my book this is a strong argument for refusing to open nbd
connections with anything but cache=unsafe.

Kevin

  reply	other threads:[~2010-10-22  8:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 14:07 [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog Kevin Wolf
2010-10-21 15:07 ` Anthony Liguori
2010-10-21 19:32   ` Laurent Vivier
2010-10-22  8:29     ` Kevin Wolf [this message]
2010-10-22 12:58       ` Anthony Liguori
2010-10-22 13:35         ` Kevin Wolf
2010-10-22 13:45           ` Anthony Liguori
2010-10-22 13:57             ` Kevin Wolf
2010-10-22 14:01               ` Anthony Liguori
2010-10-22  5:43 ` MORITA Kazutaka
2010-10-22  8:47   ` Kevin Wolf
2010-10-25  5:31     ` MORITA Kazutaka
     [not found] ` <AANLkTikHAm7opg1TzUrUWis53ENT_z6DjfT9GPeBdqA0@mail.gmail.com>
     [not found]   ` <Pine.LNX.4.64.1010211155301.18946@cobra.newdream.net>
2010-10-22  8:39     ` Fwd: " Kevin Wolf
2010-10-22 16:22       ` Sage Weil
2010-10-25  7:58         ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CC14B60.7090900@redhat.com \
    --to=kwolf@redhat.com \
    --cc=Laurent@vivier.eu \
    --cc=Qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).