[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/29] qemu_memalign: Allow small alignments
From: |
Benoît Canet |
Subject: |
Re: [Qemu-devel] [PATCH v3 04/29] qemu_memalign: Allow small alignments |
Date: |
Fri, 17 Jan 2014 23:49:41 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Le Friday 17 Jan 2014 à 15:14:54 (+0100), Kevin Wolf a écrit :
> The functions used by qemu_memalign() require an alignment that is at
> least sizeof(void*). Adjust it if it is too small.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Wenchao Xia <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> ---
> util/oslib-posix.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index e00a44c..54f8932 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -85,6 +85,11 @@ void *qemu_oom_check(void *ptr)
> void *qemu_memalign(size_t alignment, size_t size)
> {
> void *ptr;
> +
> + if (alignment < sizeof(void*)) {
> + alignment = sizeof(void*);
> + }
> +
> #if defined(_POSIX_C_SOURCE) && !defined(__sun__)
> int ret;
> ret = posix_memalign(&ptr, alignment, size);
> --
> 1.8.1.4
>
>
Reviewed-by: Benoît Canet <address@hidden>
- [Qemu-devel] [PATCH v3 01/29] block: Move initialisation of BlockLimits to bdrv_refresh_limits(), (continued)
- [Qemu-devel] [PATCH v3 02/29] block: Inherit opt_transfer_length, Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 03/29] block: Update BlockLimits when they might have changed, Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 04/29] qemu_memalign: Allow small alignments, Kevin Wolf, 2014/01/17
- Re: [Qemu-devel] [PATCH v3 04/29] qemu_memalign: Allow small alignments,
Benoît Canet <=
- [Qemu-devel] [PATCH v3 05/29] block: Detect unaligned length in bdrv_qiov_is_aligned(), Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 06/29] block: Don't use guest sector size for qemu_blockalign(), Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 08/29] raw: Probe required direct I/O alignment, Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 09/29] block: Introduce bdrv_aligned_preadv(), Kevin Wolf, 2014/01/17
- [Qemu-devel] [PATCH v3 10/29] block: Introduce bdrv_co_do_preadv(), Kevin Wolf, 2014/01/17