All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management
Date: Wed, 23 Aug 2017 08:56:44 +0200	[thread overview]
Message-ID: <8b26f12e-c453-1e46-5bc5-4446ac94ecca@redhat.com> (raw)
In-Reply-To: <20170823041358.GA21343@lemon>

On 23/08/2017 06:13, Fam Zheng wrote:
> On Tue, 08/22 15:18, Paolo Bonzini wrote:
>> diff --git a/docs/pr-manager.rst b/docs/pr-manager.rst
> 
> Is docs/interop/persistent-reservation-manager.rst better? (Move to interop/ and
> de-abbreviate) ...
> 
>> new file mode 100644
>> index 0000000000..b6089fb57c
>> --- /dev/null
>> +++ b/docs/pr-manager.rst
>> @@ -0,0 +1,51 @@
>> +======================================
>> +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.
>> +
>> +For this reason, QEMU's SCSI passthrough devices, ``scsi-block``
>> +and ``scsi-generic`` (both are only available on Linux) can delegate
>> +implementation of persistent reservations to a separate object,
>> +the "persistent reservation manager".  Only PERSISTENT RESERVE OUT and
>> +PERSISTENT RESERVE IN commands are passed to the persistent reservation
>> +manager object; other commands are processed by QEMU as usual.
>> +
>> +-----------------------------------------
>> +Defining a persistent reservation manager
>> +-----------------------------------------
>> +
>> +A persistent reservation manager is an instance of a subclass of the
>> +"pr-manager" QOM class.
> 
> Or is this abstraction class the reason it is not under interop? Why not just
> define the protocol?

It is not under interop because this is user documentation.  The
protocol documentation is under interop because the protocol is public,
and if someone else wants to talk to qemu-pr-helper they can.

(If the protocol was private, the protocol documentation would have been
under docs/devel).

Paolo

>> +
>> +Right now only one subclass is defined, ``pr-manager-helper``, which
>> +forwards the commands to an external privileged helper program
>> +over Unix sockets.  The helper program only allows sending persistent
>> +reservation commands to devices for which QEMU has a file descriptor,
>> +so that QEMU will not be able to effect persistent reservations
>> +unless it has access to both the socket and the device.
>> +
>> +``pr-manager-helper`` has a single string property, ``path``, which
>> +accepts the path to the helper program's Unix socket.  For example,
>> +the following command line defines a ``pr-manager-helper`` object and
>> +attaches it to a SCSI passthrough device::
>> +
>> +      $ qemu-system-x86_64
>> +          -device virtio-scsi \
>> +          -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
>> +          -drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
>> +          -device scsi-block,drive=hd
>> +
>> +Alternatively, using ``-blockdev``::
>> +
>> +      $ qemu-system-x86_64
>> +          -device virtio-scsi \
>> +          -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
>> +          -blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
>> +          -device scsi-block,drive=hd
> 
> Fam
> 

  reply	other threads:[~2017-08-23  6:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 13:18 [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 01/10] scsi: rename scsi_convert_sense Paolo Bonzini
2017-08-22 13:38   ` Philippe Mathieu-Daudé
2017-08-22 13:18 ` [Qemu-devel] [PATCH 02/10] scsi: move non-emulation specific code to scsi/ Paolo Bonzini
2017-08-22 13:34   ` Philippe Mathieu-Daudé
2017-08-22 13:18 ` [Qemu-devel] [PATCH 03/10] scsi: introduce scsi_build_sense Paolo Bonzini
2017-08-22 13:35   ` Philippe Mathieu-Daudé
2017-08-30 13:39   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno Paolo Bonzini
2017-08-22 13:45   ` Philippe Mathieu-Daudé
2017-08-22 13:53     ` Paolo Bonzini
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h Paolo Bonzini
2017-08-22 13:37   ` Philippe Mathieu-Daudé
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management Paolo Bonzini
2017-08-23  4:13   ` Fam Zheng
2017-08-23  6:56     ` Paolo Bonzini [this message]
2017-08-24 15:37   ` Eric Blake
2017-08-24 15:47     ` Paolo Bonzini
2017-08-30 12:59   ` Daniel P. Berrange
2017-08-30 14:26   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 07/10] io: add qio_channel_read/write_all Paolo Bonzini
2017-08-23  5:08   ` Fam Zheng
2017-08-23  6:54     ` Paolo Bonzini
2017-08-30 12:52   ` Daniel P. Berrange
2017-08-30 14:33   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 08/10] scsi: build qemu-pr-helper Paolo Bonzini
2017-08-22 14:34   ` Marc-André Lureau
2017-08-22 16:04     ` Paolo Bonzini
2017-08-24 15:45   ` Eric Blake
2017-08-30 15:44   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper Paolo Bonzini
2017-08-23  5:01   ` Fam Zheng
2017-08-23  6:50     ` Paolo Bonzini
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-30 16:37   ` Stefan Hajnoczi
2017-09-11  9:14     ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper Paolo Bonzini
2017-08-23  4:49   ` Fam Zheng
2017-08-23  6:55     ` Paolo Bonzini
2017-08-23  7:48     ` Paolo Bonzini
2017-08-30 16:58   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:48 ` [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:51 ` 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=8b26f12e-c453-1e46-5bc5-4446ac94ecca@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.