qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] buffer alignment for block backends


From: Anthony Liguori
Subject: Re: [Qemu-devel] buffer alignment for block backends
Date: Wed, 08 Apr 2009 13:53:52 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Stefano Stabellini wrote:
Hi all,
I am having an issue with the alignment of the buffers given to the
block backends. In particular, at the moment we are allocating buffers
512 bytes aligned while the backend I am working on (block-vbd) needs
page alignment.

There is no requirement for this. The block block-raw-posix backend deals with bouncing the buffers if it has to. A few places do qemu_memalign() allocs as an optimization to avoid the bouncing but it's not strictly required.

If you do not want to do that, another possible solution is to create a
new function called "qemu_blockalign" that would be implemented as
qemu_memalign(512, size);

This is fine, but this is purely an optimization, it cannot be relied upon in the general case.

 so we don't have to write 512 bytes everywhere
but only in one place, thus making life easier to people like me that
have to change the value for a special case.

Thanks in advance for your sympathy :)

Why does your backend requirement page alignment and who's notion of page?

Regards,

Anthony Liguori

Stefano Stabellini







reply via email to

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