]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: backup: Hint at proper selinux labelling of the FD-passed NBD socket
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 May 2025 13:15:35 +0000 (15:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 20 May 2025 05:35:54 +0000 (07:35 +0200)
In case selinux is used on the host the socket passed to qemu needs to
be properly labelled. Add a hint to the example code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/formatbackup.rst

index 155a45a22fcbe3327c2530723f4659c9f5a1f5b6..df6392e3bd2729c95e0c2693e4f3523942abdd1f 100644 (file)
@@ -53,6 +53,10 @@ were supplied). The following child elements and attributes are supported:
 
      import socket
      import libvirt
+     import selinux
+
+     # Optionally setup selinux context for the socket if the distro uses it
+     # selinux.setsockcreatecon_raw("system_u:object_r:svirt_t:s0")
 
      s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
      s.bind("/path/to/socket")