Re: [PATCH] util: fix thinko in runIO

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

 



On 11/24/2011 08:36 AM, Paolo Bonzini wrote:
> When aligning you need to clear the bits in the mask and leave the
> others aside.  Likely this code has never run, and will never run.

Indeed; Linux has posix_memalign, and mingw never runs the io helper
(although it does compile it, hence the #if).  If gnulib would give us
posix_memalign on mingw, we could nuke this #if altogether.

> 
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
>  src/util/iohelper.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/iohelper.c b/src/util/iohelper.c
> index 9e7bbde..93154f8 100644
> --- a/src/util/iohelper.c
> +++ b/src/util/iohelper.c
> @@ -98,7 +98,7 @@ runIO(const char *path, int fd, int oflags, unsigned long long length)
>          goto cleanup;
>      }
>      base = buf;
> -    buf = (char *) (((intptr_t) base + alignMask) & alignMask);
> +    buf = (char *) (((intptr_t) base + alignMask) & ~alignMask);

ACK and pushed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]