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

Dietmar Maurer dietmar at proxmox.com
Thu May 28 19:00:38 CEST 2015

> On Thu, May 28, 2015 at 7:19 PM, Dietmar Maurer <dietmar at proxmox.com> wrote:
> >> Each kvm process have multiple threads and the number of them is
> >> changing in time.
> >
> > AFAIK all disk IO is done by a single, dedicated thread.
> I tried to read qemu-kvm code but it is difficult for me as I have
> never written C code. 

The qemu block driver code is very difficult, even if you are used to write C.

> Whatever way it works we have the issue "buffer
> changes while writing". If anybody can understand and explain why it
> changes and may be even suggest a way to fix would be great. 

Your test code was a really interesting example, and lead to
really unexpected results (at least for me). But as Eneko already
mentioned, nobody would write such code. It is simply not thread save,
and I think qemu does it correctly.

I guess the only way to track that further down is to write test code
using the qemu-io layer.

> Meanwhile
> if somebody implemented the "default cache" option for a storage
> object it would help a lot for end-users like me.

any volunteer?

More information about the pve-devel mailing list