[PATCH 0/5] Document lxc.conf and libxl.conf locations

This is a continuation of effort started here, where I documented qemu.conf location: https://listman.redhat.com/archives/libvir-list/2021-March/msg00276.html Michal Prívozník (5): docs: Capitalize QEMU driver reference manpages: Remove reference to a session daemon for LXC docs: Document lxc.conf location manpages: Remove reference to a session daemon for libxl docs: Document libxl.conf location docs/drvlxc.html.in | 10 ++++++++++ docs/drvxen.html.in | 11 +++++++++++ docs/manpages/libvirtd.rst | 17 ++++++++++------- docs/manpages/virtlxcd.rst | 38 +++++++++++-------------------------- docs/manpages/virtqemud.rst | 2 +- docs/manpages/virtxend.rst | 38 +++++++++++-------------------------- 6 files changed, 54 insertions(+), 62 deletions(-) -- 2.26.2

In official docs we refer to it as "QEMU driver", not "qemu driver". Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/manpages/virtqemud.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manpages/virtqemud.rst b/docs/manpages/virtqemud.rst index d82d09ee61..ea8d6e3105 100644 --- a/docs/manpages/virtqemud.rst +++ b/docs/manpages/virtqemud.rst @@ -112,7 +112,7 @@ The default configuration file used by ``virtqemud``, unless overridden on the command line using the ``-f`` | ``--config`` option. In addition to the default configuration file, ``virtqemud`` reads -configuration for the qemu driver from: +configuration for the QEMU driver from: * ``@SYSCONFDIR@/libvirt/qemu.conf`` -- 2.26.2

The LXC driver has no session daemon therefore its split daemon (virtlxcd) has to be ran as root. Any attempt to start it with euid != 0 fails. This is why the daemon does not look under any of XDG_* paths either. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/manpages/virtlxcd.rst | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/docs/manpages/virtlxcd.rst b/docs/manpages/virtlxcd.rst index f89d70ba21..b9aca6c857 100644 --- a/docs/manpages/virtlxcd.rst +++ b/docs/manpages/virtlxcd.rst @@ -103,8 +103,8 @@ On receipt of ``SIGHUP`` ``virtlxcd`` will reload its configuration. FILES ===== -When run as *root* ------------------- +The ``virtlxcd`` program must be ran as root. Trying to start the program under +a different user results in error. * ``@SYSCONFDIR@/libvirt/virtlxcd.conf`` @@ -124,31 +124,6 @@ The TLS **Server** private key ``virtlxcd`` will use. The PID file to use, unless overridden by the ``-p`` | ``--pid-file`` option. -When run as *non-root* ----------------------- - -* ``$XDG_CONFIG_HOME/libvirt/virtlxcd.conf`` - -The default configuration file used by ``virtlxcd``, unless overridden on the -command line using the ``-f``|``--config`` option. - -* ``$XDG_RUNTIME_DIR/libvirt/virtlxcd-sock`` -* ``$XDG_RUNTIME_DIR/libvirt/virtlxcd-admin-sock`` - -The sockets ``virtlxcd`` will use. - -* ``$XDG_RUNTIME_DIR/libvirt/virtlxcd.pid`` - -The PID file to use, unless overridden by the ``-p``|``--pid-file`` option. - - -If ``$XDG_CONFIG_HOME`` is not set in your environment, ``virtlxcd`` will use -``$HOME/.config`` - -If ``$XDG_RUNTIME_DIR`` is not set in your environment, ``virtlxcd`` will use -``$HOME/.cache`` - - EXAMPLES ======== -- 2.26.2

This is similar to my earlier commit which documented qemu.conf locations. Luckily, the LXC driver has only the system connection and not session or embed one. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/drvlxc.html.in | 10 ++++++++++ docs/manpages/libvirtd.rst | 16 +++++++++------- docs/manpages/virtlxcd.rst | 9 +++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in index b8a99272e6..23aae991a2 100644 --- a/docs/drvlxc.html.in +++ b/docs/drvlxc.html.in @@ -281,6 +281,16 @@ causes libvirt to activate the user namespace feature. </p> +<h2><a id="configFiles">Location of configuration files</a></h2> + +<p> +The LXC driver comes with sane default values. However, during its +initialization it reads a configuration file which offers system +administrator to override some of that default. The file is located +under <code>/etc/libvirt/lxc.conf</code> +</p> + + <h2><a id="activation">Systemd Socket Activation Integration</a></h2> <p> diff --git a/docs/manpages/libvirtd.rst b/docs/manpages/libvirtd.rst index 6545dc58d3..6466be3b8d 100644 --- a/docs/manpages/libvirtd.rst +++ b/docs/manpages/libvirtd.rst @@ -136,15 +136,17 @@ When run as *root* The default configuration file used by ``libvirtd``, unless overridden on the command line using the ``-f`` | ``--config`` option. -If QEMU driver is installed, then the following file is also read: +Depending on what driver is installed, then the following files are also read: -* ``@SYSCONFDIR@/libvirt/qemu.conf`` +* ``@SYSCONFDIR@/libvirt/qemu.conf`` for the QEMU driver +* ``@SYSCONFDIR@/libvirt/lxc.conf`` for the LXC driver -This file contains various knobs and default values for virtual machines -created within QEMU driver, and offers a way to override the built in defaults, -for instance (but not limited to): paths to various supplementary binaries, TLS -certificates location, graphical consoles configuration and others. Location of -this file can't be overridden by any command line switch. +These files contain various knobs and default values for virtual machines +created within their respective drivers, and offer a way to override the built +in defaults, for instance (but not limited to): paths to various supplementary +binaries, TLS certificates location, graphical consoles configuration and +others. Location of neither of these files can be overridden by any command +line switch. * ``@RUNSTATEDIR@/libvirt/libvirt-sock`` * ``@RUNSTATEDIR@/libvirt/libvirt-sock-ro`` diff --git a/docs/manpages/virtlxcd.rst b/docs/manpages/virtlxcd.rst index b9aca6c857..2e9d8fd14b 100644 --- a/docs/manpages/virtlxcd.rst +++ b/docs/manpages/virtlxcd.rst @@ -111,6 +111,15 @@ a different user results in error. The default configuration file used by ``virtlxcd``, unless overridden on the command line using the ``-f`` | ``--config`` option. +In addition to the default configuration file, ``virtlxcd`` reads +configuration for the LXC driver from: + +* ``@SYSCONFDIR@/libvirt/lxc.conf`` + +This file contains various knobs and default values for virtual machines +created within LXC driver, and offers a way to override the built in defaults, +Location of this file can't be overridden by any command line switch. + * ``@RUNSTATEDIR@/libvirt/virtlxcd-sock`` * ``@RUNSTATEDIR@/libvirt/virtlxcd-sock-ro`` * ``@RUNSTATEDIR@/libvirt/virtlxcd-admin-sock`` -- 2.26.2

The libxl driver has no session daemon therefore its split daemon (virtxend) has to be ran as root. Any attempt to start it with euid != 0 fails. This is why the daemon does not look under any of XDG_* paths either. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/manpages/virtxend.rst | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/docs/manpages/virtxend.rst b/docs/manpages/virtxend.rst index 53592d24c0..f94ba80afa 100644 --- a/docs/manpages/virtxend.rst +++ b/docs/manpages/virtxend.rst @@ -103,8 +103,8 @@ On receipt of ``SIGHUP`` ``virtxend`` will reload its configuration. FILES ===== -When run as *root* ------------------- +The ``virtxend`` program must be ran as root. Trying to start the program under +a different user results in error. * ``@SYSCONFDIR@/libvirt/virtxend.conf`` @@ -124,31 +124,6 @@ The TLS **Server** private key ``virtxend`` will use. The PID file to use, unless overridden by the ``-p`` | ``--pid-file`` option. -When run as *non-root* ----------------------- - -* ``$XDG_CONFIG_HOME/libvirt/virtxend.conf`` - -The default configuration file used by ``virtxend``, unless overridden on the -command line using the ``-f``|``--config`` option. - -* ``$XDG_RUNTIME_DIR/libvirt/virtxend-sock`` -* ``$XDG_RUNTIME_DIR/libvirt/virtxend-admin-sock`` - -The sockets ``virtxend`` will use. - -* ``$XDG_RUNTIME_DIR/libvirt/virtxend.pid`` - -The PID file to use, unless overridden by the ``-p``|``--pid-file`` option. - - -If ``$XDG_CONFIG_HOME`` is not set in your environment, ``virtxend`` will use -``$HOME/.config`` - -If ``$XDG_RUNTIME_DIR`` is not set in your environment, ``virtxend`` will use -``$HOME/.cache`` - - EXAMPLES ======== -- 2.26.2

This is similar to my earlier commit which documented lxc.conf location. Just like LXC, the libxl driver has only the system connection and thus only few places need changing. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/drvxen.html.in | 11 +++++++++++ docs/manpages/libvirtd.rst | 1 + docs/manpages/virtxend.rst | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in index da94952e42..95be36c879 100644 --- a/docs/drvxen.html.in +++ b/docs/drvxen.html.in @@ -50,6 +50,17 @@ xen+tcp://example.com/system (remote access, SASl/Kerberos) xen+ssh://root@example.com/system (remote access, SSH tunnelled) </pre> + + <h2><a id="configFiles">Location of configuration files</a></h2> + + <p> + The libxl driver comes with sane default values. However, during its + initialization it reads a configuration file which offers system + administrator to override some of that default. The file is located + under <code>/etc/libvirt/libxl.conf</code> + </p> + + <h2><a id="imex">Import and export of libvirt domain XML configs</a></h2> <p> diff --git a/docs/manpages/libvirtd.rst b/docs/manpages/libvirtd.rst index 6466be3b8d..ee72f08382 100644 --- a/docs/manpages/libvirtd.rst +++ b/docs/manpages/libvirtd.rst @@ -140,6 +140,7 @@ Depending on what driver is installed, then the following files are also read: * ``@SYSCONFDIR@/libvirt/qemu.conf`` for the QEMU driver * ``@SYSCONFDIR@/libvirt/lxc.conf`` for the LXC driver +* ``@SYSCONFDIR@/libvirt/libxl.conf`` for the libxl driver These files contain various knobs and default values for virtual machines created within their respective drivers, and offer a way to override the built diff --git a/docs/manpages/virtxend.rst b/docs/manpages/virtxend.rst index f94ba80afa..b08346b489 100644 --- a/docs/manpages/virtxend.rst +++ b/docs/manpages/virtxend.rst @@ -111,6 +111,15 @@ a different user results in error. The default configuration file used by ``virtxend``, unless overridden on the command line using the ``-f`` | ``--config`` option. +In addition to the default configuration file, ``virtxend`` reads +configuration for the libxl driver from: + +* ``@SYSCONFDIR@/libvirt/libxl.conf`` + +This file contains various knobs and default values for virtual machines +created within libxl driver, and offers a way to override the built in +defaults, Location of this file can't be overridden by any command line switch. + * ``@RUNSTATEDIR@/libvirt/virtxend-sock`` * ``@RUNSTATEDIR@/libvirt/virtxend-sock-ro`` * ``@RUNSTATEDIR@/libvirt/virtxend-admin-sock`` -- 2.26.2

On Fri, 2021-03-12 at 09:24 +0100, Michal Privoznik wrote:
This is a continuation of effort started here, where I documented qemu.conf location:
https://listman.redhat.com/archives/libvir-list/2021-March/msg00276.html
Michal Prívozník (5): docs: Capitalize QEMU driver reference manpages: Remove reference to a session daemon for LXC docs: Document lxc.conf location manpages: Remove reference to a session daemon for libxl docs: Document libxl.conf location
docs/drvlxc.html.in | 10 ++++++++++ docs/drvxen.html.in | 11 +++++++++++ docs/manpages/libvirtd.rst | 17 ++++++++++------- docs/manpages/virtlxcd.rst | 38 +++++++++++-------------------------- docs/manpages/virtqemud.rst | 2 +- docs/manpages/virtxend.rst | 38 +++++++++++-------------------------- 6 files changed, 54 insertions(+), 62 deletions(-)
Great stuff, thanks for taking care of this! Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Michal Privoznik