qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_D


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT)
Date: Tue, 20 May 2008 20:05:16 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Anthony Liguori wrote:
Paul Brook wrote:
When sector-aligned guest offsets are converted to sector-unaligned
writes (e.g. due to qcow2 etc.), that property is no longer satisfied,
and power failure of the host disk can cause more damage than the
guest is designed to be resistant to.

Seems like the easiest solution would be to have qcow always align its writes. We don't do on the fly compression, so it should be fairly easy to make this happen with minimal overhead.

That's not sufficient. O_DIRECT imposes not only offset alignment requirements but also requirements on the buffer being read to. Most of the code in QEMU does not properly align the read/write buffers.

For instance, the kernel loading code passes a buffer on the stack to bdrv_read().

That's a problem with the current patch honestly, we should not rely on callers to align buffers. bdrv_read()/bdrv_aio_read()/bdrv_pread() all should be tolerant of unaligned buffers if we're going to support O_DIRECT.

Regards,

Anthony Liguori

Regards,

Anthony Liguori

Paul








reply via email to

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