aboutsummaryrefslogtreecommitdiff
path: root/docs/pr-manager.rst
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-08-22 06:50:18 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-09-22 21:07:24 +0200
commitb855f8d175a0a26c9798cbc5962bb8c0d9538231 (patch)
tree06ef9b853e3700eb33aaccd9ffba4c0922baaf42 /docs/pr-manager.rst
parent7c9e527659c67d4d7b41d9504f93d2d7ee482488 (diff)
scsi: build qemu-pr-helper
Introduce a privileged helper to run persistent reservation commands. This lets virtual machines send persistent reservations without using CAP_SYS_RAWIO or out-of-tree patches. The helper uses Unix permissions and SCM_RIGHTS to restrict access to processes that can access its socket and prove that they have an open file descriptor for a raw SCSI device. The next patch will also correct the usage of persistent reservations with multipath devices. It would also be possible to support for Linux's IOC_PR_* ioctls in the future, to support NVMe devices. For now, however, only SCSI is supported. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/pr-manager.rst')
-rw-r--r--docs/pr-manager.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/pr-manager.rst b/docs/pr-manager.rst
index b6089fb57c..7107e59fb8 100644
--- a/docs/pr-manager.rst
+++ b/docs/pr-manager.rst
@@ -49,3 +49,36 @@ Alternatively, using ``-blockdev``::
-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
+
+----------------------------------
+Invoking :program:`qemu-pr-helper`
+----------------------------------
+
+QEMU provides an implementation of the persistent reservation helper,
+called :program:`qemu-pr-helper`. The helper should be started as a
+system service and supports the following option:
+
+-d, --daemon run in the background
+-q, --quiet decrease verbosity
+-f, --pidfile=path PID file when running as a daemon
+-k, --socket=path path to the socket
+-T, --trace=trace-opts tracing options
+
+By default, the socket and PID file are placed in the runtime state
+directory, for example :file:`/var/run/qemu-pr-helper.sock` and
+:file:`/var/run/qemu-pr-helper.pid`. The PID file is not created
+unless :option:`-d` is passed too.
+
+:program:`qemu-pr-helper` can also use the systemd socket activation
+protocol. In this case, the systemd socket unit should specify a
+Unix stream socket, like this::
+
+ [Socket]
+ ListenStream=/var/run/qemu-pr-helper.sock
+
+After connecting to the socket, :program:`qemu-pr-helper`` can optionally drop
+root privileges, except for those capabilities that are needed for
+its operation. To do this, add the following options:
+
+-u, --user=user user to drop privileges to
+-g, --group=group group to drop privileges to