Skip to content

Commit

Permalink
[doc] ammend ivshmem_kvmfr to make cgroups and permissions clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Mar 8, 2024
1 parent cae410d commit 778c210
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions doc/ivshmem_kvmfr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ dmesg:
You should now also have the character device ``/dev/kvmfr0``

.. code:: bash
$ ls -l /dev/kvmfr0
crw------- 1 root root 242, 0 Mar 5 05:53 /dev/kvmfr0
.. warning::

If you start the VM prior to loading the module, QEMU will create the file
Expand Down Expand Up @@ -184,19 +189,32 @@ legacy syntax for IVSHMEM setup:

Running libvirt this way violates AppArmor and cgroups policies, which will
block the VM from running. These policies must be amended to allow the VM
to start:
to start.

.. tip::

If you are not sure, you likely have cgroups also as this is usually deployed
and configured by default by most distributions when you install libvirt.

- For AppArmor, create ``/etc/apparmor.d/local/abstractions/libvirt-qemu`` if
it doesn't exist, and add the following::
AppArmor
""""""""

# Looking Glass
/dev/kvmfr0 rw,
Create ``/etc/apparmor.d/local/abstractions/libvirt-qemu`` if it doesn't exist
and add the following:

- For cgroups, edit ``/etc/libvirt/qemu.conf``, uncomment the
``cgroup_device_acl`` block, and add ``/dev/kvmfr0`` to the list.
Then restart ``libvirtd``:
.. code:: text
# Looking Glass
/dev/kvmfr0 rw,
cgroups
"""""""

.. code:: bash
Edit the file ``/etc/libvirt/qemu.conf`` and uncomment the ``cgroup_device_acl``
block, adding ``/dev/kvmfr0`` to the list. To make this change active you then
must restart ``libvirtd``

.. code:: bash
sudo systemctl restart libvirtd.service
Expand Down

0 comments on commit 778c210

Please sign in to comment.