[pve-devel] Default cache mode for VM hard drives

Eneko Lacunza elacunza at binovo.es
Thu May 28 15:17:37 CEST 2015

On 28/05/15 15:01, Stanislav German-Evtushenko wrote:
>> Note that without O_DIRECT you won't get a "correct" result either; disk
>> may end not containing the data in the buffer when write was called.
>> Softmirror data will be identically uncertain :)
> You are right. That is why I suppose there is a bug (operations with
> buffer are not ensured to be thread-safe) in QEMU-KVM.
What does it mean that operations with buffer are not ensured to be 
thread-safe in qemu?

O_DIRECT doesn't guarantee that buffer reading is finished when write 
returns if I read "man -s 2 open" correctly. So this means the only 
cache modes in QEMU that are "predictable" to use are writethrough and 
writeback. All others use O_DIRECT (excluding "unsafe" for obvious reasons).

I have a feeling that this is what you are trying to tell from the 
beginning? :)

Zuzendari Teknikoa / Director Técnico
Binovo IT Human Project, S.L.
Telf. 943575997
Astigarraga bidea 2, planta 6 dcha., ofi. 3-2; 20180 Oiartzun (Gipuzkoa)

More information about the pve-devel mailing list