Skip to content

scsi, block: introduce persistent reservation managers

Paolo Bonzini qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 12 repliesIn review
  2. v1 RFC10 patches 33 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4scsi, file-posix: add support for persistent reservation managementMakefile.objs block/file-posix.c docs/pr-manager.rst +5 more+255 -10 replies
2/4scsi: build qemu-pr-helperMakefile configure docs/interop/pr-helper.rst +3 more+858 -12 replies
3/4scsi: add multipath support to qemu-pr-helperMakefile configure docs/pr-manager.rst +3 more+441 -60 replies
4/4scsi: add persistent reservation manager using qemu-pr-helperscsi/Makefile.objs scsi/pr-manager-helper.c+303 -18 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStefan Hajnoczi
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/4] scsi, block: introduce persistent reservation managers

SCSI persistent Reservations allow restricting access to block devices to specific initiators in a shared storage setup. When implementing clustering of virtual machines, it is a common requirement for virtual machines to send persistent reservation SCSI commands. However, the operating system restricts sending these commands to unprivileged programs because incorrect usage can disrupt regular operation of the storage fabric.

With these patches, the scsi-block and scsi-generic SCSI passthrough devices learn to delegate the implementation of persistent reservations to a separate object, the "persistent reservation manager". The persistent reservation manager talks to a separate privileged program, with a very simple protocol based on SCM_RIGHTS. In addition to invoking PERSISTENT RESERVATION OUT and PERSISTENT RESERVATION IN commands, the privileged component can also use libmpathpersist so that persistent reservations are applied to all paths in a multipath setting.

Patch 1 defines the abstract QOM class and plugs it into block/file-posix.c.

Patch 2 and 3 introduce the privileged helper program, while patch 4 defines the concrete QOM class that talks to it.

Paolo

v1->v2: removed scsi/ patches which were all reviewed
removed man page (requires .texi while I used .rst for docs) qio_channel_read/write_all also went in independently
fix installation of qemu-pr-helper man page
fixes to documentation
added BSD license to protocol header
added handling of residual (buffer underrun)
fixed closing of file descriptors on error
block PERSISTENT RESERVE OUT for read-only file descriptors do not use g_assert
use EXIT_SUCCESS/EXIT_FAILURE consistently
moved all CONFIG_MPATH usage to the right patch
drop CAP_SYS_ADMIN if multipath not compiled in
simplify buffer size handling in multipath PERSISTENT RESERVE IN block REGISTER AND MOVE operation for multipath PERSISTENT RESERVE OUT fixed transport id handling in multipath PERSISTENT RESERVE OUT fixed string property double-free in pr-manager-helper fixed/cleaned up error handling in pr-manager-helper

Paolo Bonzini (9):
scsi, file-posix: add support for persistent reservation management
scsi: build qemu-pr-helper
scsi: add multipath support to qemu-pr-helper
scsi: add persistent reservation manager using qemu-pr-helper

 Makefile                   |   14 +-
 configure                  |   59 ++-
 docs/interop/pr-helper.rst |   83 ++++
 docs/pr-manager.rst        |   60 +++
 include/scsi/utils.h       |    4 +
 scsi/Makefile.objs         |    2 +-
 scsi/pr-helper.h           |   41 ++
 scsi/pr-manager-helper.c   |  302 +++++++++++++
 scsi/qemu-pr-helper.c      | 1038 ++++++++++++++++++++++++++++++++++++++++++++
 scsi/utils.c               |   10 +
 10 files changed, 1607 insertions(+), 6 deletions(-)
Signature · 1 line
2.13.5