public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] block: Add 'posix' option for file locking
@ 2026-03-26  9:19 Silvan Kaiser
  2026-03-26  9:19 ` [PATCH 1/3] " Silvan Kaiser
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Silvan Kaiser @ 2026-03-26  9:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, kwolf, hreitz, pierrick.bouvier, eblake, armbru,
	Silvan Kaiser

QEMU currently supports three values for the 'locking' property of
file-based block devices: 'auto' (the default), 'on', and 'off'.
When OFD (Open File Descriptor) locks are available, 'auto' and 'on'
use them; when they are not, 'on' falls back to POSIX locks with a
warning.

This series adds a fourth value, 'posix', which explicitly forces the
use of traditional POSIX locks (F_SETLK/F_GETLK) regardless of OFD
availability.  The motivation is that some userspace filesystem
implementations (e.g. FUSE) handle POSIX locks correctly but do not
fully support OFD lock semantics.  Issues with OFD support detection
on underlying file systems and some OFD guarantees not being fully
supported can prohibit users from using the default OFD locking.
Previously, users in this situation had no way to force POSIX locking
without disabling locking entirely.

The series is structured as:
  1/3 - core implementation in block/file-posix.c, util/osdep.c,
        include/qemu/osdep.h and qapi/block-core.json
  2/3 - documentation updates in qemu-options.hx and
        docs/system/qemu-block-drivers.rst.inc
  3/3 - new iotest 315 verifying the option is accepted without
        fallback warnings and that POSIX locks are applied

Silvan Kaiser (3):
  block: Add 'posix' option for file locking
  docs/system: Document locking=posix option for file block driver
  tests/qemu-iotests: Add test 315 for locking=posix

 block/file-posix.c                     | 18 ++++--
 docs/system/qemu-block-drivers.rst.inc |  3 +
 include/qemu/osdep.h                   |  1 +
 qapi/block-core.json                   | 18 +++++-
 qemu-options.hx                        | 10 +--
 tests/qemu-iotests/315                 | 88 ++++++++++++++++++++++++++
 tests/qemu-iotests/315.out             |  7 ++
 util/osdep.c                           |  9 ++-
 8 files changed, 139 insertions(+), 15 deletions(-)
 create mode 100755 tests/qemu-iotests/315
 create mode 100644 tests/qemu-iotests/315.out

-- 
2.47.3


-- 
Quobyte GmbH, Berlin, AG Charlottenburg HRB 149012 B, Dr. Felix Hupfeld, 
Dr. Bjoern Kolbeck


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-26  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26  9:19 [PATCH v1 0/3] block: Add 'posix' option for file locking Silvan Kaiser
2026-03-26  9:19 ` [PATCH 1/3] " Silvan Kaiser
2026-03-26  9:19 ` [PATCH 2/3] docs/system: Document locking=posix option for file block driver Silvan Kaiser
2026-03-26  9:19 ` [PATCH 3/3] tests/qemu-iotests: Add test 315 for locking=posix Silvan Kaiser
2026-03-26  9:34 ` [PATCH v1 0/3] block: Add 'posix' option for file locking Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox