mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-09 12:38:27 -05:00
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user