[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] file-posix: Do runtime check for ofd lock A
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] file-posix: Do runtime check for ofd lock API |
Date: |
Fri, 21 Jul 2017 07:36:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/21/2017 05:20 AM, Fam Zheng wrote:
> It is reported that on Windows Subsystem for Linux, ofd operations fail
> with -EINVAL. In other words, QEMU binary built with system headers that
> exports F_OFD_SETLK doesn't necessarily run in an environment that
> actually supports it:
>
> $ qemu-system-aarch64 ... -drive file=test.vhdx,if=none,id=hd0 \
> -device virtio-blk-pci,drive=hd0
> qemu-system-aarch64: -drive file=test.vhdx,if=none,id=hd0: Failed to unlock
> byte 100
> qemu-system-aarch64: -drive file=test.vhdx,if=none,id=hd0: Failed to unlock
> byte 100
> qemu-system-aarch64: -drive file=test.vhdx,if=none,id=hd0: Failed to lock
> byte 100
>
> Let's do a runtime check to cope with that.
You may want to mention that the same is possible on a system with old
kernel but new glibc (ie. this issue is not necessarily specific to WSL).
>
> Reported-by: Andrew Baumann <address@hidden>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/file-posix.c | 19 ++++++++-----------
> 1 file changed, 8 insertions(+), 11 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature