From: Peter Krempa Date: Mon, 19 May 2025 13:15:35 +0000 (+0200) Subject: docs: backup: Hint at proper selinux labelling of the FD-passed NBD socket X-Git-Tag: v11.4.0-rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c3920e35d3c97970088a9840a252ffbb02f7e1;p=thirdparty%2Flibvirt.git docs: backup: Hint at proper selinux labelling of the FD-passed NBD socket 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 Reviewed-by: Ján Tomko --- diff --git a/docs/formatbackup.rst b/docs/formatbackup.rst index 155a45a22f..df6392e3bd 100644 --- a/docs/formatbackup.rst +++ b/docs/formatbackup.rst @@ -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")