qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com, qemu-block@nongnu.org, eblake@redhat.com,
	Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	christian.ehrhardt@canonical.com,
	Andrew Baumann <Andrew.Baumann@microsoft.com>,
	jsnow@redhat.com
Subject: [Qemu-devel] [PATCH for-2.10? v2 0/2] block: Do OFD lock check at runtime
Date: Fri, 11 Aug 2017 17:53:26 +0800	[thread overview]
Message-ID: <20170811095328.13298-1-famz@redhat.com> (raw)

v2: Probe /dev/null to save LOC. [Eric]
    Mention "new glibc + old kernel" in commit message. [Kevin, Daniel, Eric,
    Christian]

This fixes the image opening failure reported by Andrew Baumann:

> I'm running a recent Linux build of qemu on Windows Subsystem for Linux (WSL)
> which doesn't appear to implement file locking:
>
> $ 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

It appears to be that the binary is built for Linux targets, but the WSL
runtime doesn't recognize the ops (-EINVAL).

This is also a practical problem for Linux considering it's possible to run
QEMU which is built against a new glibc on an old kernel that doesn't have OFD
API.

Convert to runtime check to cope with that.

Fam Zheng (2):
  osdep: Add runtime OFD lock detection
  file-posix: Do runtime check for ofd lock API

 block/file-posix.c   | 19 +++++++---------
 include/qemu/osdep.h |  1 +
 util/osdep.c         | 63 ++++++++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 63 insertions(+), 20 deletions(-)

-- 
2.13.4

             reply	other threads:[~2017-08-11  9:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11  9:53 Fam Zheng [this message]
2017-08-11  9:53 ` [Qemu-devel] [PATCH for-2.10? v2 1/2] osdep: Add runtime OFD lock detection Fam Zheng
2017-08-11  9:53 ` [Qemu-devel] [PATCH for-2.10? v2 2/2] file-posix: Do runtime check for ofd lock API Fam Zheng
2017-08-11 10:11 ` [Qemu-devel] [PATCH for-2.10? v2 0/2] block: Do OFD lock check at runtime no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170811095328.13298-1-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=berrange@redhat.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).