[PATCH 0/4] ch: Fix location of config file for system URI
*** BLURB HERE *** Michal Prívozník (4): docs: Document supported URIs for CH driver drvch: Demote example section to a subsection ch: Load ch.conf from SYSCONFDIR drvch: Document config file locations docs/drvch.rst | 33 ++++++++++++++++++++++++++++----- src/ch/ch_conf.c | 3 +-- 2 files changed, 29 insertions(+), 7 deletions(-) -- 2.51.0
From: Michal Privoznik <mprivozn@redhat.com> Our docs suggest that only session mode is supported for CH drvier. Well, that's clearly not case. Document the system URI and refer to other (remote) supported transport modes (yeah, that works too). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/drvch.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/drvch.rst b/docs/drvch.rst index bb13599e6f..b8c48a775b 100644 --- a/docs/drvch.rst +++ b/docs/drvch.rst @@ -12,13 +12,20 @@ customers inside a cloud provider. For our purposes this means modern operating systems with most I/O handled by paravirtualised devices (i.e. virtio), no requirement for legacy devices, and 64-bit CPUs. -The libvirt Cloud Hypervisor driver is intended to be run as a session -driver without privileges. The cloud-hypervisor binary itself should be -``setcap cap_net_admin+ep`` (in order to create tap interfaces). +The libvirt Cloud Hypervisor (CH) driver is intended to be run as a +session driver without privileges. The cloud-hypervisor binary itself +should be ``setcap cap_net_admin+ep`` (in order to create tap +interfaces). Though, system-wide connection URI is also supported. Expected connection URI would be -``ch:///session`` +:: + + ch:///session (local access to per-user instance) + ch:///system (local access to system instance) + +But all other transport modes are supported too +(see `documentation <uri.html#remote-uris>`__). Example guest domain XML configurations -- 2.51.0
From: Michal Privoznik <mprivozn@redhat.com> In our drvch.rst there's a section with example XML. Demote it to a subsection ('-') since the whole document starts with section ('=') and this paragraph is really just a child of the root. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/drvch.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/drvch.rst b/docs/drvch.rst index b8c48a775b..2f900b785b 100644 --- a/docs/drvch.rst +++ b/docs/drvch.rst @@ -29,7 +29,7 @@ But all other transport modes are supported too Example guest domain XML configurations -======================================= +--------------------------------------- The Cloud Hypervisor driver in libvirt is in its early stage under active development only supporting a limited number of Cloud Hypervisor features. -- 2.51.0
From: Michal Privoznik <mprivozn@redhat.com> Config files for system instances of our drivers (e.g. "ch:///system", "qemu:///system", etc.) live under /etc/libvirt. But for some reason, the CH driver was trying to load the config file from /var/lib/libvirt/ch/ even though the file is installed under /etc/libvirt per the following line from src/meson.build: install_data(virt_conf_files, install_dir: confdir) Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/ch/ch_conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c index 8a542eef19..6896683b7f 100644 --- a/src/ch/ch_conf.c +++ b/src/ch/ch_conf.c @@ -178,8 +178,7 @@ virCHDriverConfigNew(bool privileged) cfg->logDir = g_strdup_printf("%s/log/libvirt/ch", LOCALSTATEDIR); cfg->stateDir = g_strdup_printf("%s/libvirt/ch", RUNSTATEDIR); cfg->saveDir = g_strdup_printf("%s/lib/libvirt/ch/save", LOCALSTATEDIR); - cfg->configDir = g_strdup_printf("%s/lib/libvirt/ch", LOCALSTATEDIR); - + cfg->configDir = g_strdup(SYSCONFDIR "/libvirt"); } else { g_autofree char *rundir = NULL; g_autofree char *cachedir = NULL; -- 2.51.0
From: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/drvch.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/drvch.rst b/docs/drvch.rst index 2f900b785b..b9effc4409 100644 --- a/docs/drvch.rst +++ b/docs/drvch.rst @@ -28,6 +28,22 @@ But all other transport modes are supported too (see `documentation <uri.html#remote-uris>`__). +Location of configuration files +------------------------------- + +The CH driver comes with sane default values. However, during its +initialization it reads a configuration file which offers system +administrator or an user to override some of that default. The location +of the file depends on the connection URI, as follows: + +=================== ====================================== +``ch:///system`` ``/etc/libvirt/ch.conf`` +``ch:///session`` ``$XDG_CONFIG_HOME/libvirt/ch/ch.conf`` +=================== ====================================== + +If ``$XDG_CONFIG_HOME`` is not set in the environment, it defaults to +``$HOME/.config``. + Example guest domain XML configurations --------------------------------------- -- 2.51.0
On Fri, Oct 31, 2025 at 10:56:21 +0100, Michal Privoznik wrote:
*** BLURB HERE ***
Michal Prívozník (4): docs: Document supported URIs for CH driver drvch: Demote example section to a subsection ch: Load ch.conf from SYSCONFDIR drvch: Document config file locations
docs/drvch.rst | 33 ++++++++++++++++++++++++++++----- src/ch/ch_conf.c | 3 +-- 2 files changed, 29 insertions(+), 7 deletions(-)
Reviewed-by: Jiri Denemark <jdenemar@redhat.com> And safe for freeze.
participants (2)
-
Jiri Denemark -
Michal Privoznik