aboutsummaryrefslogtreecommitdiff
path: root/docs/tools/qemu-pr-helper.rst
blob: eaebe40da0ea2bdbb1568df43275381fc971187c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
==================================
QEMU persistent reservation helper
==================================

Synopsis
--------

**qemu-pr-helper** [*OPTION*]

Description
-----------

Implements the persistent reservation helper for QEMU.

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. QEMU's SCSI passthrough devices ``scsi-block``
and ``scsi-generic`` support passing guest persistent reservation
requests to a privileged external helper program. :program:`qemu-pr-helper`
is that external helper; it creates a socket which QEMU can
connect to to communicate with it.

If you want to run VMs in a setup like this, this helper should be
started as a system service, and you should read the QEMU manual
section on "persistent reservation managers" to find out how to
configure QEMU to connect to the socket created by
:program:`qemu-pr-helper`.

After connecting to the socket, :program:`qemu-pr-helper` can
optionally drop root privileges, except for those capabilities that
are needed for its operation.

: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

Options
-------

.. program:: qemu-pr-helper

.. option:: -d, --daemon

  run in the background (and create a PID file)

.. option:: -q, --quiet

  decrease verbosity

.. option:: -v, --verbose

  increase verbosity

.. option:: -f, --pidfile=PATH

  PID file when running as a daemon. By default the PID file
  is created in the system runtime state directory, for example
  :file:`/var/run/qemu-pr-helper.pid`.

.. option:: -k, --socket=PATH

  path to the socket. By default the socket is created in
  the system runtime state directory, for example
  :file:`/var/run/qemu-pr-helper.sock`.

.. option:: -T, --trace [[enable=]PATTERN][,events=FILE][,file=FILE]

  .. include:: ../qemu-option-trace.rst.inc

.. option:: -u, --user=USER

  user to drop privileges to

.. option:: -g, --group=GROUP

  group to drop privileges to

.. option:: -h, --help

  Display a help message and exit.

.. option:: -V, --version

  Display version information and exit.