qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog


From: Kevin Wolf
Subject: Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog
Date: Fri, 22 Oct 2010 10:29:20 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100907 Fedora/3.0.7-1.fc12 Thunderbird/3.0.7

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 via email to

[Prev in Thread] Current Thread [Next in Thread]