Re: [PATCH 01/13] tools: Fix vshControl declaration and initialization
Thu, 3 Aug 2023 21:38:02 +0200 Michal Prívozník : > it looks like we're using { 0 } everywhere else so that's why I went with it. I was under the impression {} is valid. But apparently it is not, so I learned something new today: "ISO C forbids empty initializer braces". Olaf pgpbERjk73Jqj.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH 01/13] tools: Fix vshControl declaration and initialization
Thu, 3 Aug 2023 12:36:08 +0200 Michal Privoznik : > +vshControl _ctl = { 0 }; I see this often, instead of a simple 'type variable = {};', and wonder what that zero is doing here? Olaf pgpesWu2O0JH7.pgp Description: Digitale Signatur von OpenPGP
Re: [libvirt PATCH 6/9] src: set max open file limit to match systemd >= 240 defaults
Wed, 21 Jun 2023 14:32:29 +0100 Daniel P. Berrangé : > -LimitNOFILE=8192 > +LimitNOFile=512000:1024 Did someone really rename that knob in upstream systemd? My copy of systemd.directives(7) still lists the uppercase variant. As a result this change means the knob is now not recognized anymore. Olaf pgpnBOFE0vRul.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] ci: disable usage of libattr in Leap
Mon, 3 Jul 2023 15:10:41 +0200 Peter Krempa : > Could you explain why this is needed in the first place? Just to make it clear that attr can not be used in this environment because it is slightly older than expected. I missed the header of that file, sorry. Olaf pgphVvhzI4iCe.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] ci: disable usage of libattr in Leap
Commit dffeef89ef ("meson: attr_dep switch to dependency()") made libattr.pc mandatory. Signed-off-by: Olaf Hering --- ci/containers/opensuse-leap-15.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile index ca11edf808..4bfbe8057f 100644 --- a/ci/containers/opensuse-leap-15.Dockerfile +++ b/ci/containers/opensuse-leap-15.Dockerfile @@ -37,7 +37,6 @@ RUN zypper update -y && \ kmod \ libacl-devel \ libapparmor-devel \ - libattr-devel \ libblkid-devel \ libcap-ng-devel \ libcurl-devel \ @@ -95,3 +94,4 @@ ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" ENV NINJA "/usr/bin/ninja" ENV PYTHON "/usr/bin/python3" +ENV MESON_OPTS "-Dattr=disabled"
Re: [PATCH v1] use libexecdir as location for qemu-bridge-helper
Tue, 2 May 2023 14:47:20 +0100 Andrea Bolognani : > I have patches for turning these build time lookups into runtime lookups > almost ready. I'm curious, and will wait for these changes to appear in #master. Olaf pgpIWg7XPw4Jf.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] use libexecdir as location for qemu-bridge-helper
The current logic in meson.build assumes a fixed runtime path for qemu-bridge-helper in case this binary is not available during build. Since qemu-bridge-helper is not used during build it is not required to have it installed at build time. It is likely that both qemu and libvirt are built with the same --libexecdir option. So use this as the expected location for qemu-bridge-helper. Signed-off-by: Olaf Hering --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c2a2f306c1..6ca05e2f69 100644 --- a/meson.build +++ b/meson.build @@ -1653,7 +1653,7 @@ if not get_option('driver_qemu').disabled() if qemu_bridge_prog.found() qemu_bridge_path = qemu_bridge_prog.full_path() else - qemu_bridge_path = '/usr/libexec/qemu-bridge-helper' + qemu_bridge_path = libexecdir / 'qemu-bridge-helper' endif conf.set_quoted('QEMU_BRIDGE_HELPER', qemu_bridge_path)
Re: libvirt-guests configurability regression
Wed, 9 Nov 2022 09:04:12 -0800 Andrea Bolognani : > Olaf, can you please remind me why the files we dropped were > problematic but these ones apparently aren't? These are equally problematic because they are owned by the admin as well. They are essentially empty, their content is a duplication from doc/ (I hope). They should not be part of libvirt.git. The upgrade needs to be handled like it is done with libvirt_sysconfig_pre/libvirt_sysconfig_posttrans in libvirt.spec. Olaf pgpOaXc7bjhKJ.pgp Description: Digitale Signatur von OpenPGP
Re: libvirt-guests configurability regression
Tue, 8 Nov 2022 10:07:21 -0800 Andrea Bolognani : > I think a reasonable compromise would be to add > Environment=URIS="default" > Environment=ON_BOOT="start" > to libvirt-guests.service. The script needs to be adjusted to recognize existing environment variables. Olaf pgpvjwpBXZwMm.pgp Description: Digitale Signatur von OpenPGP
Re: libvirt-guests configurability regression
Tue, 8 Nov 2022 08:46:34 +0100 Laszlo Ersek : > Can you at least include the previously shipped *documented* config file > as a template in a contrib or docs directory or something? This is up to the maintainers of libvirt.git to decide. If I were in charge, nothing would be installed into /etc. What needs to go there, in case it is required, is already reasonably well documented. Olaf pgpoxBNHmXIEK.pgp Description: Digitale Signatur von OpenPGP
Re: libvirt-guests configurability regression
Mon, 7 Nov 2022 14:17:00 +0100 Laszlo Ersek : > The (a) well-documented and (b) easily editable config file > "/etc/sysconfig/libvirt-guests" is now gone. Right, these admin-owned files are not installed anymore. The runtime code still uses the files, in case they are created by the admin. > The message on commit 8eb4461645c5 says, > Remove the sysconfig file and place the current desired default into > the service file. Yes, and right in the next paragraph the commit messages states the files are (still) recognized. As of f8b6c7e5, libvirt-guests.sh initializes some internal defaults, then it loads the admin-owned sysconfig file, in case it was created. The documentation about this specific tool (libvirt-guests(1)) states what values from /etc/sysconfig/libvirt-guests will be recognized. While browsing various user mailing lists in the past years I often saw messages like "system was upgraded to new version, and as a result an expected file somewhere in /etc does not exist anymore. What now?". Apparently some folks expect files to be present before they can be edited. In my experience it is always possible to create the required files and fill them with the desired content, based on available documentation. Olaf pgptuDn5TxfZY.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: recognize sles when guessing default_qemu_user
Wed, 26 Jan 2022 07:14:34 -0800 Andrea Bolognani : > Patches here: > https://listman.redhat.com/archives/libvir-list/2022-January/msg01189.html Looks good at a fist glance, thanks! Olaf pgpxddTm1q9oa.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: recognize sles when guessing default_qemu_user
Tue, 25 Jan 2022 10:11:01 -0800 Andrea Bolognani : > Do you mean that if the user has passed > -Dqemu_user=... -Dqemu_group=... > to meson we could skip the detection logic? That'd be nice, but I'm > afraid it might make the code less readable for very little gain. The whole thing will be just a whitespace change because it goes into its own block: qemu_user = get_option('qemu_user') qemu_group = get_option('qemu_group') if qemu_user == '' or qemu_group == '' if host_machine.system() in [ 'freebsd', 'darwin' ] default_qemu_user = 'root' default_qemu_group = 'wheel' else os_release = run_command('grep', '^ID=', '/etc/os-release', check: true).stdout() if os_release.contains('arch') default_qemu_user = 'nobody' default_qemu_group = 'nobody' elif (os_release.contains('centos') or os_release.contains('fedora') or os_release.contains('gentoo') or os_release.contains('rhel') or os_release.contains('sles') or os_release.contains('suse')) default_qemu_user = 'qemu' default_qemu_group = 'qemu' elif os_release.contains('debian') default_qemu_user = 'libvirt-qemu' default_qemu_group = 'libvirt-qemu' elif os_release.contains('ubuntu') default_qemu_user = 'libvirt-qemu' default_qemu_group = 'kvm' else default_qemu_user = 'root' default_qemu_group = 'root' endif # If the expected user and group don't exist, or we haven't hit any # of the cases above bacuse we're running on an unknown OS, the only # sensible fallback is root:root if (run_command('getent', 'passwd', default_qemu_user, check: false).returncode() != 0 and run_command('getent', 'group', default_qemu_group, check: false).returncode() != 0) default_qemu_user = 'root' default_qemu_group = 'root' endif endif qemu_group = default_qemu_group qemu_user = default_qemu_user endif conf.set_quoted('QEMU_USER', qemu_user) conf.set_quoted('QEMU_GROUP', qemu_group) This looks like an opportunity to get rid of default_qemu_user/group. The getent part is bogus because it forces the user/group to be present on the system which is building libvirt. This build system is usually not the system which runs libvirt. Please fix bug this as well. Olaf pgpgVxQfWH3q3.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: recognize sles when guessing default_qemu_user
Tue, 25 Jan 2022 10:11:01 -0800 Andrea Bolognani : > Are you going to take a stab at these patches? No, I will just add sles-release to BuildRequires. Olaf pgpGDf1Va_edK.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: recognize sles when guessing default_qemu_user
Tue, 25 Jan 2022 09:16:33 -0800 Andrea Bolognani : > /etc/os-release being absent should not result in a build failure. Yes. This should be the first thing to fix. Commit 29cd1877acd91883df32bf71ec07fe908e96db32 does not say why ID= was used. This grep should be relaxed to ID_LIKE=. Furthermore, if both qemu_user and qemu_group are known, no grep is required. Olaf pgprqjtDYdWpd.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: recognize sles when guessing default_qemu_user
Tue, 25 Jan 2022 14:17:23 +0100 Olaf Hering : > Commit 4c69d64efa3731d074d198f871fd42e74c4a39f6 revealed the bug, > /etc/os-release must exist during build. Now that a missing ^ID= became fatal, was it actually a good idea to be explicit? I think poking around for clues in ^ID_LIKE= will be more robust, appending 'sles' would be not required. Olaf pgp3FI9zmzCv7.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] meson: recognize sles when guessing default_qemu_user
NAME="SLES" VERSION="15-SP3" VERSION_ID="15.3" PRETTY_NAME="SUSE Linux Enterprise Server 15 SP3" ID="sles" ID_LIKE="suse" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:15:sp3" DOCUMENTATION_URL="https://documentation.suse.com/; Signed-off-by: Olaf Hering --- meson.build | 1 + 1 file changed, 1 insertion(+) Commit 4c69d64efa3731d074d198f871fd42e74c4a39f6 revealed the bug, /etc/os-release must exist during build. diff --git a/meson.build b/meson.build index b6d1286f3f..b2d9e8ed65 100644 --- a/meson.build +++ b/meson.build @@ -1673,6 +1673,7 @@ if not get_option('driver_qemu').disabled() os_release.contains('fedora') or os_release.contains('gentoo') or os_release.contains('rhel') or +os_release.contains('sles') or os_release.contains('suse')) default_qemu_user = 'qemu' default_qemu_group = 'qemu'
Re: [PATCH v2] docs: domain: document legacy audio for qemu
Mon, 17 Jan 2022 08:09:11 -0800 Andrea Bolognani : > On Wed, Jan 12, 2022 at 01:42:00PM +0100, Olaf Hering wrote: > > Adding a blurb like this was forgotten in 2009. > How did you come up with 2009? Not questioning it, just curious :) I think the variables and the docs appeared in git at that time. > But your version works fine too if you're keen on keeping > it as is :) I'm fine with whatever unblocks the sysconfig removal. Olaf pgprsXaWefpwB.pgp Description: Digitale Signatur von OpenPGP
[PATCH v2] docs: domain: document legacy audio for qemu
Adding a blurb like this was forgotten in 2009. Signed-off-by: Olaf Hering --- docs/formatdomain.rst | 14 ++ 1 file changed, 14 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..f07ea34232 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7079,6 +7079,20 @@ is permitted with the following attributes. The audio format, one of ``s8``, ``u8``, ``s16``, ``u16``, ``s32``, ``u32``, ``f32``. The default is hypervisor specific. +Note: +If no element is defined, and the ``graphics`` element is set to +either 'vnc' or 'sdl', the libvirtd or virtqemud process will honor the following +environment variables: + +* ``SDL_AUDIODRIVER`` + + Valid values are 'pulseaudio', 'esd', 'alsa' or 'arts'. + +* ``QEMU_AUDIO_DRV`` + + Valid values are 'pa', 'pulseaudio', 'none', 'alsa', 'coreaudio', 'jack', + 'oss', 'sdl', 'spice' or 'file'. + None audio backend ^^
[PATCH v8 2/2] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index b5893627e3..cfa1b379f6 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -57,6 +57,16 @@ v8.0.0 (unreleased) * libxl: Implement the virDomainGetMessages API + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirtd. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes** * qemu: Fix device hot-unplug with ``libvirt-7.9`` or ``libvirt-7.10`` used with ``qemu-6.2``
[PATCH v8 1/2] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- docs/daemons.rst| 21 docs/remote.html.in | 6 +-- libvirt.spec.in | 69 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 1 + src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 1 + src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 52 files changed, 93 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index c8ae3b0cef..1f9bc34260 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,24 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service files: +either a systemd "drop-in" configuration file, or a ``/etc/sysconfig/$daemon`` +file must be created. For example, to change the command line option +for a debug session of ``libvirtd``, create a file +``/etc/systemd/system/libvirtd.service.d/debug.conf`` with the followin
[PATCH v8 0/2] remove sysconfig files
remove comments for legacy qemu audio remove comments from libvirt-guests script rebased to 4902dc68e555ccf28af3427f75661c54a2fffc0f Olaf Hering (2): remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 docs/daemons.rst| 21 docs/remote.html.in | 6 +-- libvirt.spec.in | 69 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 1 + src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 1 + src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 103 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
Re: [PATCH v6 3/4] remove sysconfig files
Mon, 3 Jan 2022 03:18:11 -0800 Andrea Bolognani : > The fact that we still QEMU_AUDIO_DRV and SDL_AUDIODRIVER in the > service file even after your changes goes against this principle. So what should be done about these? I think whoever added support for these environment variables a couple of decades ago failed to provide proper documentation. Or perhaps whoever wrote the "sound" section of formatdomain.html.in failed to recognize the existence of these environment variables. So in the end I will now sit down and write some blurb into the sound section of formatdomain.rst, just to get this series off the table... Olaf pgpfll0vtYfbf.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virdnsmasq: fix runtime search for executable
Mon, 10 Jan 2022 16:46:49 +0100 Michal Prívozník : > Huh, so my patches turned out to be similar to yours. They appear to work for me, no more error reported. I do not use dnsmasq, no idea if it actually works with or without this series. Olaf pgpxlbaPXiGzU.pgp Description: Digitale Signatur von OpenPGP
Re: [libvirt PATCH v2 1/1] virt-ssh-helper: Add manual page
Mon, 10 Jan 2022 13:29:28 + Andrea Bolognani : > I'm definitely open to moving it if you can make a convincing enough case for > it :) I was hoping the binary can be moved to libexec, which means a man page is not strictly required. But apparently this can not be done due to the way how it is implemented. Olaf pgpwgsJou8VyP.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virdnsmasq: fix runtime search for executable
Tue, 17 Aug 2021 15:13:05 +0200 Pavel Hrdina : > On Wed, Aug 11, 2021 at 11:47:13AM +0200, Olaf Hering wrote: > > dnsmasq is an optional binary which does not neccessary exist during build. > > > > Signed-off-by: Olaf Hering > > --- > > src/util/virdnsmasq.c | 28 +++- > > 1 file changed, 23 insertions(+), 5 deletions(-) > > Is there any error or incorrect behavior that you are trying to fix? > I did audit the code and within the virdnsmasq.c file we use the > binaryPath with virCommandRun() which will do this same check before > acutally execing, see virExec(). The error was, and still is today, like this: Jan 10 12:53:36 rdma03 libvirtd[1725]: Cannot check dnsmasq binary dnsmasq: No such file or directory How do you intent to fix this? Olaf pgpo_kr_VYffI.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH] docs: Add man page for libvirt-guests
Fri, 7 Jan 2022 14:38:15 -0700 Jim Fehlig : > +The following environment variables can be used to alter the behavior of > +``libvirt-guests`` I think the script does not take environment variables at this point. In its current form the only way to configure it is a sysconfig file which redefines the variables. This fact should be mentioned. Olaf pgp34wx1CJlRr.pgp Description: Digitale Signatur von OpenPGP
Re: [libvirt PATCH v2 1/1] virt-ssh-helper: Add manual page
Mon, 13 Dec 2021 14:44:51 +0100 Andrea Bolognani : > +``virt-ssh-helper`` is an internal tool If it is indeed an internal tool, why is the man page in section 1, and why is it in PATH? I think the man page needs to be moved to section 8, the binary into $libexec. The path to it will be known, the shell code from virNetClientSSHHelperCommand could be removed. There would be no requirement for which.rpm, which is also not noted as Requires in libvirt.spec. Olaf pgpYzxlCKTvxF.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v7 0/2] remove sysconfig files
Wed, 5 Jan 2022 12:13:28 -0700 Jim Fehlig : > Thanks for reviewing v6! It looks like Olaf has addressed all of your > comments. I plan to provide a man page for libvirt-guests, just did not get around to actually write it down. Olaf pgpcPVCn1OI00.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v6 3/4] remove sysconfig files
Mon, 3 Jan 2022 03:18:11 -0800 Andrea Bolognani : > The fact that we still QEMU_AUDIO_DRV and SDL_AUDIODRIVER in the > service file even after your changes goes against this principle. These variables are probably stale. But, I just looked briefly at the code and could not figure out within minutes what the purpose was. Perhaps I will remove them as well in case a v8 is required. Olaf pgpu37DJXPzuk.pgp Description: Digitale Signatur von OpenPGP
[PATCH v7 0/2] remove sysconfig files
style issues in docs/ and libvirt.spec.in (abologna) rebased to 4b77b194069f048e6efdaf5d363098ae039dc4f5 Olaf Hering (2): remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 docs/daemons.rst| 21 docs/remote.html.in | 6 +-- libvirt.spec.in | 69 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 54 files changed, 155 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
[PATCH v7 1/2] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- docs/daemons.rst| 21 docs/remote.html.in | 6 +-- libvirt.spec.in | 69 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 145 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index c8ae3b0cef..1f9bc34260 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,24 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service files: +either a systemd "drop-in" configuration file, or a ``/etc/sysconfig/$daemon`` +file must be created. For example, to change the command line option +for a debug session of ``libvirtd``, create a file +``/e
[PATCH v7 2/2] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e7d5316721..9255113df4 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -44,6 +44,16 @@ v8.0.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirtd. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes**
Re: [PATCH v6 3/4] remove sysconfig files
Thu, 23 Dec 2021 10:29:33 -0800 Andrea Bolognani : > On Tue, Dec 21, 2021 at 12:22:44PM +0100, Olaf Hering wrote: > > --- a/src/remote/libvirtd.sysconf > > +++ /dev/null > > @@ -1,21 +0,0 @@ > > -# If systemd socket activation is disabled, then the following > > -# can be used to listen on TCP/TLS sockets > > -#LIBVIRTD_ARGS="--listen" > > This bit about passing --listen to libvirtd got lost during the move > to the unit file. Please make sure you preserve it. It was wrong from day one to have this fragment here. Documentation belongs to the doc directory. > > +++ b/tools/libvirt-guests.sh.in > > @@ -30,13 +30,53 @@ test ! -r "$sysconfdir"/rc.d/init.d/functions || > > > > export TEXTDOMAIN="@PACKAGE@" TEXTDOMAINDIR="@localedir@" > > > > +# URIs to check for running guests > > +# example: URIS='default xen:///system vbox+tcp://host/system > > lxc:///system' > > URIS="default" > [...] > > This is the bit I still not entirely convinced of. > > After this change, libvirt-guests' configuration becomes entirely > opaque: the only way the admin can learn how to configure the service > is by somehow realizing that it's a shell script as opposed to a > binary and looking inside it. > > Can we do better? libvirt-guests is undocumented. The file type is easy to guess, based on the filename in libvirt-guests.service. The Documentation= setting in this file is wrong, libvirtd(8) says nothing about this functionality. Initial documentation has to be provided as a separate change, by creating a new docs/whatever.rst. Olaf pgp4axu0WOtoi.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v6 4/4] NEWS: mention removal of sysconfig
Tue, 21 Dec 2021 16:33:11 -0700 Jim Fehlig : > What do you think of the below, slightly reworded variant? As a native speaker you are in the perfect position to formulate a suitable paragraph for the NEWS file. This new variant is certainly fine with me. If it is supposed to go into "Packaging changes" or "Improvements", no idea. Olaf pgpQXXiH4Uvlz.pgp Description: Digitale Signatur von OpenPGP
[PATCH v6 4/4] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e7d5316721..9255113df4 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -44,6 +44,16 @@ v8.0.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirtd. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes**
[PATCH v6 3/4] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- docs/daemons.rst| 20 +++ docs/remote.html.in | 6 +-- libvirt.spec.in | 69 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 144 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index 8a05ee77a7..1b6396d2af 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,23 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service files: +Either a systemd "drop-in" configuration file, or a ``/etc/sysconfig/$daemon`` +file must be created. For example, changing the command line option +for a debug session of ``libvirtd``, create a file +``/etc/syst
[PATCH v6 1/4] rpm: fix %preun of virtnetworkd
Fixes: 50eae3f8859c746aa474401b38902fa500f23fad ("rpm: handle enabling/disabling modular daemons post/postun-install") Signed-off-by: Olaf Hering --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f6c705564a..16be1e173e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1388,7 +1388,7 @@ fi %endif %libvirt_daemon_schedule_restart virtnetworkd -%preun +%preun daemon-driver-network %libvirt_daemon_systemd_preun virtnetworkd %postun daemon-driver-network
[PATCH v6 2/4] libvirt.spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 16be1e173e..7bd74da2c9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1466,6 +1466,21 @@ fi %if %{with_qemu} +%pre daemon-driver-qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else +useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 + %post daemon-driver-qemu %if %{with_modular_daemons} %libvirt_daemon_systemd_post virtqemud @@ -1587,23 +1602,6 @@ done %libvirt_daemon_perform_restart libvirtd %libvirt_daemon_perform_restart virtnwfilterd -%if %{with_qemu} -%pre daemon-driver-qemu -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then -useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else -useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi -exit 0 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin
[PATCH v6 0/4] remove sysconfig files
fix virtnetworkd avoid duplicate %posttrans sections (berrange) add comment to %libvirt_sc_pre (berrange) rebased to adc0eaead0ebe11f38798e431d2748bfe9b54a30 Olaf Hering (4): rpm: fix %preun of virtnetworkd libvirt.spec: relocate pre script of daemon-driver-qemu remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 +++ docs/daemons.rst| 20 + docs/remote.html.in | 6 +- libvirt.spec.in | 103 src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 - src/remote/meson.build | 10 --- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 + tools/libvirt-guests.sysconf| 50 tools/meson.build | 6 -- 54 files changed, 170 insertions(+), 263 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
[PATCH v5 0/3] remove sysconfig files
fix path to sysconfig file in NEWS.rst (jfehlig) rebased to 85574319952af2cf538d185bd58e4ed3edc7a3e8 Olaf Hering (3): libvirt.spec: relocate pre script of daemon-driver-qemu remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 +++ docs/daemons.rst| 20 + docs/remote.html.in | 6 +- libvirt.spec.in | 99 + src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 -- src/remote/meson.build | 10 --- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 - tools/meson.build | 6 -- 54 files changed, 167 insertions(+), 262 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
[PATCH v5 2/3] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- docs/daemons.rst| 20 docs/remote.html.in | 6 +-- libvirt.spec.in | 67 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 +++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 142 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index 8a05ee77a7..1b6396d2af 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,23 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service files: +Either a systemd "drop-in" configuration file, or a ``/etc/sysconfig/$daemon`` +file must be created. For example, changing the command line option +for a debug session of ``libvirtd``, create a file +``/e
[PATCH v5 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f6c705564a..4675e67d15 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1466,6 +1466,21 @@ fi %if %{with_qemu} +%pre daemon-driver-qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else +useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 + %post daemon-driver-qemu %if %{with_modular_daemons} %libvirt_daemon_systemd_post virtqemud @@ -1587,23 +1602,6 @@ done %libvirt_daemon_perform_restart libvirtd %libvirt_daemon_perform_restart virtnwfilterd -%if %{with_qemu} -%pre daemon-driver-qemu -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then -useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else -useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi -exit 0 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin
[PATCH v5 3/3] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 4d1a1501ef..c9d1f6fb96 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -36,6 +36,16 @@ v8.0.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirtd. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes**
[PATCH v4 0/3] remove sysconfig files
rebased to 359e9f5cf4526eff630d803f68df9733abaef419 Olaf Hering (3): libvirt.spec: relocate pre script of daemon-driver-qemu remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 +++ docs/daemons.rst| 20 + docs/remote.html.in | 6 +- libvirt.spec.in | 99 + src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 -- src/remote/meson.build | 10 --- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 - tools/meson.build | 6 -- 54 files changed, 167 insertions(+), 262 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
[PATCH v4 3/3] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 4d1a1501ef..ce324afb8a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -36,6 +36,16 @@ v8.0.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirt. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes**
[PATCH v4 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 32b4243d0a..66eff7c7e8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1464,6 +1464,21 @@ fi %if %{with_qemu} +%pre daemon-driver-qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else +useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 + %post daemon-driver-qemu %if %{with_modular_daemons} %libvirt_daemon_systemd_post virtqemud @@ -1585,23 +1600,6 @@ done %libvirt_daemon_perform_restart libvirtd %libvirt_daemon_perform_restart virtnwfilterd -%if %{with_qemu} -%pre daemon-driver-qemu -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then -useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else -useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi -exit 0 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin
[PATCH v4 2/3] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- docs/daemons.rst| 20 docs/remote.html.in | 6 +-- libvirt.spec.in | 67 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 +++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 142 insertions(+), 245 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index 8a05ee77a7..1b6396d2af 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,23 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service files: +Either a systemd "drop-in" configuration file, or a ``/etc/sysconfig/$daemon`` +file must be created. For example, changing the command line option +for a debug session of ``libvirtd``, create a file +``/e
Re: Release of libvirt-7.10.0
Am Wed, 1 Dec 2021 10:59:18 +0100 (CET) schrieb Jiri Denemark : > 7.10.0 release of both libvirt and libvirt-python Will there be a v7.10.0 tag in libvirt-perl.git? Olaf pgpbUGVZy3_YS.pgp Description: Digitale Signatur von OpenPGP
Re: set custom loglevel for external libraries
Am Mon, 11 Oct 2021 13:25:20 -0600 schrieb Jim Fehlig : > >> I think it is wrong to use internal libvirt values for internal > >> libxentoollog values. > What is gained over the sparse mapping? Are values not covered actually > useful > in practice? Also, how are the values specified when using the xl tool? A > quick > peek at the code seems to imply using more 'v' options. E.g. 'xl - ...'. Since libvirt has no control about what libxentoollog values the authors use, it should provide a simple way to request a specific loglevel. xl decided to use the number of v's for it. > If such a setting is actually needed, then the proper place would be > /etc/libvirt/libxl.conf. And IMO we should avoid creating a new name that > could > potentially confuse users. If 'xentoollog_level' is the common jargon in xen, > we > should stick with the same name. If that is an acceptable approach I will try to prepare a patch. Olaf pgpUmPRy5caRf.pgp Description: Digitale Signatur von OpenPGP
Re: set custom loglevel for external libraries
This question is still open: where should the libxl specific setting be specified? Olaf Am Sun, 25 Jul 2021 10:17:49 +0200 schrieb Olaf Hering : > I think it is wrong to use internal libvirt values for internal libxentoollog > values. > > There has to be a separate configuration setting to specify the various > xentoollog_level values. It is just the question where to put such setting, > and how to name it. > > I guess no other used library provides similar internal logging, this > requirement is unique to libxenlight.so. pgpUaIKxeoRSH.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v3 0/3] remove sysconfig files
Am Fri, 24 Sep 2021 08:49:55 -0600 schrieb Jim Fehlig : > Needs rebased again :-). Sadly, yes... Olaf pgp2jGPfmD95H.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virdnsmasq: fix runtime search for executable
Am Tue, 17 Aug 2021 15:13:05 +0200 schrieb Pavel Hrdina : > Is there any error or incorrect behavior that you are trying to fix? Some code paths call stat(DNSMASQ), which this patch tries to address. Olaf pgp3ccuQnabCb.pgp Description: Digitale Signatur von OpenPGP
[PATCH v2] libxl: remove conditionals from discard configuration
LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE exists since Xen 4.5.0 Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 56cb9abd5d..9f0739e1fa 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -923,13 +923,12 @@ libxlMakeVnumaList(virDomainDef *def, return ret; } -static int -libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard) +static void +libxlDiskSetDiscard(libxl_device_disk *x_disk, virDomainDiskDiscard discard) { if (!x_disk->readwrite) -return 0; -#if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE) -switch ((virDomainDiskDiscard)discard) { +return; +switch (discard) { case VIR_DOMAIN_DISK_DISCARD_DEFAULT: case VIR_DOMAIN_DISK_DISCARD_LAST: break; @@ -940,15 +939,6 @@ libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard) libxl_defbool_set(_disk->discard_enable, false); break; } -return 0; -#else -if (discard == VIR_DOMAIN_DISK_DISCARD_DEFAULT) -return 0; -virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This version of libxenlight does not support " - "disk 'discard' option passing")); -return -1; -#endif } static char * @@ -1189,8 +1179,7 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) x_disk->removable = 1; x_disk->readwrite = !l_disk->src->readonly; x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0; -if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0) -return -1; +libxlDiskSetDiscard(x_disk, l_disk->discard); /* An empty CDROM must have the empty format, otherwise libxl fails. */ if (x_disk->is_cdrom && !x_disk->pdev_path) x_disk->format = LIBXL_DISK_FORMAT_EMPTY;
Re: [PATCH v1] libxl: remove conditionals from discard configuration
Am Fri, 13 Aug 2021 07:52:31 -0600 schrieb Jim Fehlig : > Why remove the cast? Because ->discard is of type virDomainDiskDiscard, the function can receive such type right away. Olaf pgpM9pRwd1XCQ.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] libxl: remove conditionals from discard configuration
LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE exists since Xen 4.5.0 Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 3de2f9f57a..e275996cab 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -923,13 +923,12 @@ libxlMakeVnumaList(virDomainDef *def, return ret; } -static int -libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard) +static void +libxlDiskSetDiscard(libxl_device_disk *x_disk, virDomainDiskDiscard discard) { if (!x_disk->readwrite) -return 0; -#if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE) -switch ((virDomainDiskDiscard)discard) { +return; +switch (discard) { case VIR_DOMAIN_DISK_DISCARD_DEFAULT: case VIR_DOMAIN_DISK_DISCARD_LAST: break; @@ -940,15 +939,6 @@ libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard) libxl_defbool_set(_disk->discard_enable, false); break; } -return 0; -#else -if (discard == VIR_DOMAIN_DISK_DISCARD_DEFAULT) -return 0; -virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This version of libxenlight does not support " - "disk 'discard' option passing")); -return -1; -#endif } static void @@ -1209,8 +1199,7 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) x_disk->removable = 1; x_disk->readwrite = !l_disk->src->readonly; x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0; -if (libxlDiskSetDiscard(x_disk, l_disk->discard) < 0) -return -1; +libxlDiskSetDiscard(x_disk, l_disk->discard); libxlDiskSetScript(x_disk, src); /* An empty CDROM must have the empty format, otherwise libxl fails. */
[PATCH v1] virdnsmasq: fix runtime search for executable
dnsmasq is an optional binary which does not neccessary exist during build. Signed-off-by: Olaf Hering --- src/util/virdnsmasq.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index f2f606913f..06d192c99d 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -729,8 +729,26 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool force) return ret; } +static char * +dnsmasqGetBinaryPath(void) +{ +static const char binary[] = DNSMASQ; +char *binary_path; + +if (g_path_is_absolute(binary)) +return g_strdup(binary); + +binary_path = virFindFileInPath(binary); +if (!binary_path) { +virReportSystemError(ENOENT, _("Cannot find '%s' in path"), binary); +binary_path = g_strdup(binary); +} + +return binary_path; +} + static dnsmasqCaps * -dnsmasqCapsNewEmpty(const char *binaryPath) +dnsmasqCapsNewEmpty(void) { dnsmasqCaps *caps; @@ -739,14 +757,14 @@ dnsmasqCapsNewEmpty(const char *binaryPath) if (!(caps = virObjectNew(dnsmasqCapsClass))) return NULL; caps->flags = virBitmapNew(DNSMASQ_CAPS_LAST); -caps->binaryPath = g_strdup(binaryPath ? binaryPath : DNSMASQ); +caps->binaryPath = dnsmasqGetBinaryPath(); return caps; } dnsmasqCaps * dnsmasqCapsNewFromBuffer(const char *buf) { -dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ); +dnsmasqCaps *caps = dnsmasqCapsNewEmpty(); if (!caps) return NULL; @@ -761,7 +779,7 @@ dnsmasqCapsNewFromBuffer(const char *buf) dnsmasqCaps * dnsmasqCapsNewFromBinary(void) { -dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ); +dnsmasqCaps *caps = dnsmasqCapsNewEmpty(); if (!caps) return NULL; @@ -776,7 +794,7 @@ dnsmasqCapsNewFromBinary(void) const char * dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps) { -return caps ? caps->binaryPath : DNSMASQ; +return caps ? caps->binaryPath : dnsmasqGetBinaryPath(); } unsigned long
[PATCH v3 0/3] remove sysconfig files
rebased to 919f25d36ef0ea41c50bdb5afa0b83187ffb3c87 Olaf Hering (3): libvirt.spec: relocate pre script of daemon-driver-qemu remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 +++ docs/daemons.rst| 20 + docs/remote.html.in | 2 +- libvirt.spec.in | 100 src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 - src/remote/meson.build | 10 --- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 tools/meson.build | 6 -- 54 files changed, 166 insertions(+), 260 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
[PATCH v3 3/3] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 21df0e1602..ae30255492 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -19,6 +19,16 @@ v7.7.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirt. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes**
[PATCH v3 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5c6494eefd..749f46c418 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1417,23 +1417,6 @@ fi rm -rf %{_localstatedir}/lib/rpm-state/libvirt || : -%if %{with_qemu} -%pre daemon-driver-qemu -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then -useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else -useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi -exit 0 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin @@ -1688,6 +1671,21 @@ exit 0 %endif %if %{with_qemu} +%pre daemon-driver-qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else +useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 + %files daemon-driver-qemu %config(noreplace) %{_sysconfdir}/sysconfig/virtqemud %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
[PATCH v3 2/3] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- v2: - fix libvirt_sc_pre usage - leave existing grep in sysconfig in %posttrans daemon as it is - leave existing %post daemon as it is - add empty VIRTLOCKD_ARGS= to virtlockd.service - provide drop-in example in daemons.rst --- docs/daemons.rst| 20 docs/remote.html.in | 2 +- libvirt.spec.in | 68 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 +++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 141 insertions(+), 243 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index 8a05ee77a7..1b6396d2af 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,23 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service
Re: set custom loglevel for external libraries
Am Fri, 23 Jul 2021 16:26:10 -0600 schrieb Jim Fehlig : > Does the output of DPRINTF pass the "info" smell test? :-) Or is it only > useful > for debugging? INFO vs DEBUG can be a bit gray IMO, but reviewing the use of > VIR_INFO vs VIR_DEBUG throughout the code might help decide what side of the > fence DPRINTF lies. I think it is wrong to use internal libvirt values for internal libxentoollog values. There has to be a separate configuration setting to specify the various xentoollog_level values. It is just the question where to put such setting, and how to name it. I guess no other used library provides similar internal logging, this requirement is unique to libxenlight.so. Olaf pgpDXbZLS3bFP.pgp Description: Digitale Signatur von OpenPGP
Re: set custom loglevel for external libraries
Am Thu, 22 Jul 2021 17:17:11 +0200 schrieb Olaf Hering : > xc_private.h uses XTL_INFO, XTL_DETAIL, XTL_DEBUG and XTL_ERROR in the > wrappers. I wonder if the code should map VIR_LOG_INFO to XTL_DETAIL to enable DPRINTF. Olaf pgp3lN57hElrs.pgp Description: Digitale Signatur von OpenPGP
Re: set custom loglevel for external libraries
Am Thu, 22 Jul 2021 16:07:15 +0100 schrieb Daniel P. Berrangé : > Do we actually need to care about every single level, as opposed to > just doing a sparse mapping where we squash several xen levels into > one libvirt level, as the code below shows ? xc_private.h uses XTL_INFO, XTL_DETAIL, XTL_DEBUG and XTL_ERROR in the wrappers. I think in the end all of the values can be used once execution enters libxenlight.so. The code I changed had to map the few libvirt values somehow to the XTL values. Olaf pgpCTuKzh12Ay.pgp Description: Digitale Signatur von OpenPGP
Re: set custom loglevel for external libraries
Thanks for your reply, I had no time to look at this until now. Am Wed, 16 Jun 2021 11:44:10 +0100 schrieb Daniel P. Berrangé : > Anyway if you used a virLogSource object, then turning on debugging > exclusively for libxl library messages would be as simple as > > log_filters="1:libxl.libxl_library" > > without affecting the global libvirt logging behaviour It seems log_filters= does not allow arbitrary numbers. virLogParseFilter would just allow values from 1 to 4. Such extra logfilter needs to handle a xentoollog_level, values from 1 to 9 (>XTL_NONE and logger = libxlLoggerNew(cfg->logDir, virLogGetDefaultPriority()); +cfg->logger = libxlLoggerNew(cfg->logDir); if (!cfg->logger) { VIR_ERROR(_("cannot create logger for libxenlight, disabling driver")); return -1; --- a/src/libxl/libxl_logger.c +++ b/src/libxl/libxl_logger.c @@ -129,25 +129,33 @@ libvirt_destroy(xentoollog_logger *logger_in) libxlLogger * -libxlLoggerNew(const char *logDir, virLogPriority minLevel) +libxlLoggerNew(const char *logDir) { xentoollog_logger_libvirt logger; g_autofree char *path = NULL; - -switch (minLevel) { -case VIR_LOG_DEBUG: -logger.minLevel = XTL_DEBUG; -break; -case VIR_LOG_INFO: -logger.minLevel = XTL_INFO; -break; -case VIR_LOG_WARN: -logger.minLevel = XTL_WARN; -break; -case VIR_LOG_ERROR: -logger.minLevel = XTL_ERROR; -break; +char *xenlight_minlevel = getenv("xenlight_minlevel"); +int minlevel; + +if (!(xenlight_minlevel && *xenlight_minlevel && +virStrToLong_i(xenlight_minlevel, NULL, 10, ) >= 0 && +minlevel > XTL_NONE && minlevel < XTL_NUM_LEVELS)) { +minlevel = virLogGetDefaultPriority(); +switch (minlevel) { +case VIR_LOG_DEBUG: +minlevel = XTL_DEBUG; +break; +case VIR_LOG_INFO: +minlevel = XTL_INFO; +break; +case VIR_LOG_WARN: +minlevel = XTL_WARN; +break; +case VIR_LOG_ERROR: +minlevel = XTL_ERROR; +break; +} } +logger.minLevel = minlevel; logger.logDir = logDir; if ((logger.files = virHashNew(libxlLoggerFileFree)) == NULL) --- a/src/libxl/libxl_logger.h +++ b/src/libxl/libxl_logger.h @@ -24,8 +24,7 @@ typedef struct xentoollog_logger_libvirt libxlLogger; -libxlLogger *libxlLoggerNew(const char *logDir, - virLogPriority minLevel); +libxlLogger *libxlLoggerNew(const char *logDir); void libxlLoggerFree(libxlLogger *logger); void libxlLoggerOpenFile(libxlLogger *logger, int id, const char *name, Olaf pgpcXcOTKztMi.pgp Description: Digitale Signatur von OpenPGP
[PATCH v2 2/3] remove sysconfig files
sysconfig files are owned by the admin of the host. They have the liberty to put anything they want into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- v2: - fix libvirt_sc_pre usage - leave existing grep in sysconfig in %posttrans daemon as it is - leave existing %post daemon as it is - add empty VIRTLOCKD_ARGS= to virtlockd.service - provide drop-in example in daemons.rst --- docs/daemons.rst| 20 docs/remote.html.in | 2 +- libvirt.spec.in | 68 +++-- src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 -- src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 -- src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 -- src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 -- src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 -- src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 -- src/meson.build | 16 -- src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 -- src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 -- src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 -- src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 +++ src/qemu/virtqemud.sysconf | 12 - src/remote/libvirtd.service.in | 7 +++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 -- src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 -- src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 -- src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 -- src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 -- tools/libvirt-guests.sh.in | 40 +++ tools/libvirt-guests.sysconf| 50 -- tools/meson.build | 6 --- 53 files changed, 141 insertions(+), 243 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/docs/daemons.rst b/docs/daemons.rst index 8a05ee77a7..1b6396d2af 100644 --- a/docs/daemons.rst +++ b/docs/daemons.rst @@ -686,3 +686,23 @@ socket unit names into the service. When using these old versions, the ``unix_sock_dir`` setting in ``virtlockd.conf`` must be changed in lock-step with the equivalent setting in the unit files to ensure that ``virtlockd`` can identify the sockets. + +Changing command line options for daemons += + +Two ways exist to override the defaults in the provided service
[PATCH v2 3/3] NEWS: mention removal of sysconfig
Signed-off-by: Olaf Hering --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index d95750e776..3e5b790e03 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,16 @@ v7.6.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirt. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes** * qemu: Fix migration with VIR_MIGRATE_NON_SHARED_INC
[PATCH v2 1/3] libvirt.spec: relocate pre script of daemon-driver-qemu
Reduce the delta in an upcoming change. No change in behavior intended. Signed-off-by: Olaf Hering --- libvirt.spec.in | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cb48dd0be0..85e79883c5 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1417,23 +1417,6 @@ fi rm -rf %{_localstatedir}/lib/rpm-state/libvirt || : -%if %{with_qemu} -%pre daemon-driver-qemu -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then -useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else -useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi -exit 0 -%endif - %if %{with_lxc} %pre login-shell getent group virtlogin >/dev/null || groupadd -r virtlogin @@ -1688,6 +1671,21 @@ exit 0 %endif %if %{with_qemu} +%pre daemon-driver-qemu +# We want soft static allocation of well-known ids, as disk images +# are commonly shared across NFS mounts by id rather than name; see +# https://fedoraproject.org/wiki/Packaging:UsersAndGroups +getent group kvm >/dev/null || groupadd -f -g 36 -r kvm +getent group qemu >/dev/null || groupadd -f -g 107 -r qemu +if ! getent passwd qemu >/dev/null; then + if ! getent passwd 107 >/dev/null; then +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + else +useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + fi +fi +exit 0 + %files daemon-driver-qemu %config(noreplace) %{_sysconfdir}/sysconfig/virtqemud %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
[PATCH v2 0/3] remove sysconfig files
based on 94944e38d7. Olaf Hering (3): libvirt.spec: relocate pre script of daemon-driver-qemu remove sysconfig files NEWS: mention removal of sysconfig NEWS.rst| 10 +++ docs/daemons.rst| 20 + docs/remote.html.in | 2 +- libvirt.spec.in | 100 src/ch/meson.build | 5 -- src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 -- src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 -- src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 -- src/locking/virtlockd.service.in| 1 + src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 -- src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 -- src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 src/network/meson.build | 5 -- src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 -- src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 -- src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 -- src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 - src/remote/meson.build | 10 --- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 -- src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 -- src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 -- src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 -- src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 ++ tools/libvirt-guests.sysconf| 50 tools/meson.build | 6 -- 54 files changed, 166 insertions(+), 260 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf
Re: [PATCH v1] remove sysconfig files
Am Wed, 21 Jul 2021 12:36:40 +0100 schrieb Daniel P. Berrangé : > If we remove the sysconfig files, we're not expecting users to > modify the .service files. Instead they will be using the systemd > overrides in /etc/systemd/system/libvirtd.service.d/ to > customize. It seems docs/daemons.rst already states that .service or .socket files can be tweaked, but it does not say how this needs to be done. Looking at systemd.socket(8) and ListenStream=: "These options may be specified more than once, ..." indicates that one may not be able to tweak just one knob with an override file. Instead the full unit must be provided in /etc/systemd. In the context of the proposed patch, a specific "Environment=" line will hopefully be override the system provided line reliably. I will add an example to this documentation file. The existing wording regarding sysconfig files can stay as it is. Olaf pgpeYHhoyH5I7.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] remove sysconfig files
Am Wed, 21 Jul 2021 06:00:12 -0700 schrieb Andrea Bolognani : > On Wed, Jul 21, 2021 at 01:23:56PM +0200, Olaf Hering wrote: > > There is no point in restarting libvirtd in the middle of the transaction. > > The spec file gives no ordering hints to rpm. > Note that the daemon restart always happens *after* the transaction, > in the %posttrans part. I was wrong, %systemd_post may not do a 'try-restart', but that certainly depends on what this macro actually does. At least the macros I have will just do 'daemon-reload', they do nothing with the listed units. It is not clear if 'try-restart' reloads the EnvironmentFile=. If it is indeed reloaded, a modified file will not exist at this point because it was just renamed to .rpmsave. In other words: the current '%post daemon' needs no modification. > It looks like the only documentation for the various options that can > be used to tweak the service's behavior was the one found in the > sysconfig file. Perhaps a man page should be introduced? Yeah, someone familiar with libvirt-guests.sh should provide one. This patch just moves the existing comments elsewhere. To mean it does not look like a user needs to tweak that script. > But then libvirt-guests would end up being the only service that > cannot be configured via a systemd override... I think we should > strive for consistency here. It certainly can be configured. The environment can be constructed either with a .service.d/ file or with the (optional) sysconfig file. Olaf pgprGBwqURsBe.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] remove sysconfig files
Am Wed, 21 Jul 2021 06:00:12 -0700 schrieb Andrea Bolognani : > For most software, the default configuration files consist of mostly > comments and act more like documentation for what the local > configuration might look like. Claiming that the defaults are > actually defined in the source code is correct, but also not very > useful if it means that the local admin needs to go poking at said > sources to figure out how to configure their machine... This is what documentation is for, either man/info/html pages. Too bad, configuration was misused for this in the past decades. I will respond to the other items tomorrow. Olaf pgpKLn0FD6asB.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] remove sysconfig files
Am Wed, 21 Jul 2021 12:36:40 +0100 schrieb Daniel P. Berrangé : > If we remove the sysconfig files, we're not expecting users to > modify the .service files. Instead they will be using the systemd > overrides in /etc/systemd/system/libvirtd.service.d/ to > customize. Why not /etc/sysconfig/file instead? At least such change is instantly active, and this location is well documented. A .service.d needs a daemon-reload AFAIK. Olaf pgpjRoz9B5ykm.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] remove sysconfig files
Am Wed, 21 Jul 2021 03:16:39 -0700 schrieb Andrea Bolognani : > On Tue, Jul 20, 2021 at 07:00:20PM +0200, Olaf Hering wrote: > > sysconfig files are owned by the admin of the host. He has the liberty > > to put anything he wants into these files. This makes it difficult to > > provide different built-in defaults. > s/He has/They have/ > s/he wants/they want/ I assumed a single host admin. > > +++ b/docs/remote.html.in > > @@ -139,7 +139,7 @@ Blank lines and comments beginning with # > > are ignored. > > > >Listen for secure TLS connections on the public TCP/IP port. > >Note: it is also necessary to start the server in listening mode by > > - running it with --listen or editing /etc/sysconfig/libvirtd by > > uncommenting the LIBVIRTD_ARGS="--listen" line > > + running it with --listen or editing /etc/sysconfig/libvirtd by adding a > > LIBVIRTD_ARGS="--listen" line > > This should mention the alternative method of configuring the > service, which is adding a systemd unit override for the > Environment=LIBVIRTD_ARGS=... variable. Why is that systemd part needed? The sysconfig files are recognized, they just have to be created. > I wonder if users will get this right? The interactions between the > various ways of configuring the arguments for each daemon have just > gotten more complex, and I can definitely foresee subtle > configuration mistakes happening because of it. Yes, I have seen supposedly educated people struggling with the fact that a file does not exist on-disk. > > +++ b/libvirt.spec.in > > @@ -197,6 +197,18 @@ > > +%define libvirt_sc_pre() \ > > + for sc in %{?*} ; do \ > > + test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ;\ > > + mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" > > "%{_sysconfdir}/sysconfig/${sc}.rpmsave.old" ;\ > > + done \ > > + %{nil} > > +%define libvirt_sc_posttrans() \ > > + for sc in %{?*} ; do \ > > + test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ;\ > > + mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" > > "%{_sysconfdir}/sysconfig/${sc}" ;\ > > + done \ > > + %{nil} > > Please confirm whether I understand these correctly. > > The idea is that we want existing sysconfig files to be preserved > when the package is updated, but rpm by default will rename them to > .rpmsave once it realizes the corresponding files are gone from the > package. Only files marked as %config and which have been modified will be preserved as .rpmsave. > So in %pre you make sure existing .rpmsave files are moved out of the > way, and then in %posttrans you move the current sysconfig files, > which had been renamed by rpm, them back to their original location. Stale .rpmsave files will be preserved, just in case they contain any valuable data. During upgrade rpm may create a .rpmsave file, which is then renamed back. > This will all turn into a no-op when you're upgrading from a package > where the sysconf files have already been gone to a newer version, > right? Any scenario in which the rpm run is interrupted, for example > between %pre and %posttrans, and the state becomes inconsistent? If a transaction is interrupted for whatever reason the system is in an inconstant state. No automation can get it out of such state. > > -%post daemon > > -%global post_units \\\ > > -virtlockd.socket virtlockd-admin.socket \\\ > > -virtlogd.socket virtlogd-admin.socket \\\ > > -libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket \\\ > > -libvirtd-tcp.socket libvirtd-tls.socket \\\ > > -libvirtd.service \\\ > > -libvirt-guests.service > > - > > -%systemd_post %post_units > > - > > -# request daemon restart in posttrans > > -mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : > > -touch %{_localstatedir}/lib/rpm-state/libvirt/restart || : > > - > > > > %posttrans daemon > > +%libvirt_sc_posttrans libvirtd virtproxyd virtlogd virtlockd libvirt-guests > > +%global post_units \\\ > > +virtlockd.socket virtlockd-admin.socket \\\ > > +virtlogd.socket virtlogd-admin.socket \\\ > > +libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket \\\ > > +libvirtd-tcp.socket libvirtd-tls.socket \\\ > > +libvirtd.service \\\ > > +libvirt-guests.service > > + > > +%systemd_post %post_units > > + > > +# request daemon restart in posttrans > > +mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : > > +touch %{_localst
Re: [PATCH v1] remove sysconfig files
Am Tue, 20 Jul 2021 19:00:20 +0200 schrieb Olaf Hering : > +#Environment=QEMU_AUDIO_DRV=sdl > +#Environment=SDL_AUDIODRIVER=pulse These two knobs are undocumented. Instead of dropping them I decided to put them into the service files. I do not know if both are intended for a wider audience, or just for the test suite. Olaf pgp71dZLjDjLD.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] remove sysconfig files
sysconfig files are owned by the admin of the host. He has the liberty to put anything he wants into these files. This makes it difficult to provide different built-in defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/name or /etc/systemd/system/name.service.d/my-knobs.conf Attempt to handle upgrades in libvirt.spec. Dirty files which are marked as %config will be renamed to file.rpmsave. To restore them automatically, move stale .rpmsave files away, and catch any new rpmsave files in %posttrans. Signed-off-by: Olaf Hering --- NEWS.rst| 10 ++ docs/remote.html.in | 2 +- libvirt.spec.in | 134 +++- src/ch/meson.build | 5 - src/ch/virtchd.service.in | 1 + src/ch/virtchd.sysconf | 3 - src/interface/meson.build | 5 - src/interface/virtinterfaced.service.in | 1 + src/interface/virtinterfaced.sysconf| 3 - src/libxl/meson.build | 5 - src/libxl/virtxend.service.in | 1 + src/libxl/virtxend.sysconf | 3 - src/locking/meson.build | 5 - src/locking/virtlockd.sysconf | 3 - src/logging/meson.build | 5 - src/logging/virtlogd.sysconf| 3 - src/lxc/meson.build | 5 - src/lxc/virtlxcd.service.in | 1 + src/lxc/virtlxcd.sysconf| 3 - src/meson.build | 16 --- src/network/meson.build | 5 - src/network/virtnetworkd.service.in | 1 + src/network/virtnetworkd.sysconf| 3 - src/node_device/meson.build | 5 - src/node_device/virtnodedevd.service.in | 1 + src/node_device/virtnodedevd.sysconf| 3 - src/nwfilter/meson.build| 5 - src/nwfilter/virtnwfilterd.service.in | 1 + src/nwfilter/virtnwfilterd.sysconf | 3 - src/qemu/meson.build| 5 - src/qemu/virtqemud.service.in | 7 ++ src/qemu/virtqemud.sysconf | 12 --- src/remote/libvirtd.service.in | 7 ++ src/remote/libvirtd.sysconf | 21 src/remote/meson.build | 10 -- src/remote/virtproxyd.service.in| 1 + src/remote/virtproxyd.sysconf | 3 - src/secret/meson.build | 5 - src/secret/virtsecretd.service.in | 1 + src/secret/virtsecretd.sysconf | 3 - src/storage/meson.build | 5 - src/storage/virtstoraged.service.in | 1 + src/storage/virtstoraged.sysconf| 3 - src/vbox/meson.build| 5 - src/vbox/virtvboxd.service.in | 1 + src/vbox/virtvboxd.sysconf | 3 - src/vz/meson.build | 5 - src/vz/virtvzd.service.in | 1 + src/vz/virtvzd.sysconf | 3 - tools/libvirt-guests.sh.in | 40 +++ tools/libvirt-guests.sysconf| 50 - tools/meson.build | 6 -- 52 files changed, 163 insertions(+), 276 deletions(-) delete mode 100644 src/ch/virtchd.sysconf delete mode 100644 src/interface/virtinterfaced.sysconf delete mode 100644 src/libxl/virtxend.sysconf delete mode 100644 src/locking/virtlockd.sysconf delete mode 100644 src/logging/virtlogd.sysconf delete mode 100644 src/lxc/virtlxcd.sysconf delete mode 100644 src/network/virtnetworkd.sysconf delete mode 100644 src/node_device/virtnodedevd.sysconf delete mode 100644 src/nwfilter/virtnwfilterd.sysconf delete mode 100644 src/qemu/virtqemud.sysconf delete mode 100644 src/remote/libvirtd.sysconf delete mode 100644 src/remote/virtproxyd.sysconf delete mode 100644 src/secret/virtsecretd.sysconf delete mode 100644 src/storage/virtstoraged.sysconf delete mode 100644 src/vbox/virtvboxd.sysconf delete mode 100644 src/vz/virtvzd.sysconf delete mode 100644 tools/libvirt-guests.sysconf diff --git a/NEWS.rst b/NEWS.rst index d95750e776..3e5b790e03 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,16 @@ v7.6.0 (unreleased) * **Improvements** + * packaging: sysconfig files no longer installed + +libvirt used to provide defaults in various /etc/sysconfig/ files, such +as /etc/sysconfig/libvirt. Since these files are owned by the admin, this +made it difficult to change built-in defaults in case such file was +modified by the admin. The built-in defaults are now part of the provided +systemd unit files, such as libvirtd.service. These unit files continue +to parse sysconfig files, in case they are created by the admin and filled +with the desired key=value pairs. + * **Bug fixes** * qemu: Fix migration with VIR_MIGRATE_NON_SHARED_INC diff --git a/docs/remote.html.in b/docs/remote.html.in
Re: [PATCH v1] virtqemud: remove sysconfig file
Am Mon, 19 Jul 2021 12:01:57 -0400 schrieb Andrea Bolognani : > On Fri, Jul 16, 2021 at 12:04:00PM +0200, Olaf Hering wrote: > > None of the files in /etc have to be owned by a package. > > We are slowly getting there. > Is this goal of having packages not touch /etc connected to the idea > of transactionally-updated read-only OS images? If there is an > initiative tracking progress in this area, either in the context of a > single distro or more generally, can you please point me to it? There is some effort in this area in Tumbleweed, right now one can get still up to 10k more or less bogus rpm-owned files in /etc. A /etc that is now owned by rpm certainly helps transactional updates as far as I understand it. But more importantly it is bad to install empty configuration files: They often just duplicate what is already written in /usr/share/man or doc. There is no way to get the delta between a .rpmnew file and the base version. They just waste space and time during backup and restore. Ideally /etc should contain just the tiny amount that is really required. > > /etc/sysconfig is not owned by any package, it is entirely maintained by > > the admin. > That doesn't seem to be the case at least in Fedora 34: That might be. On a SUSE system it is driven by fillup, based on fillup-templates. Olaf pgpt_lhxfIa_W.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virtqemud: remove sysconfig file
Am Mon, 19 Jul 2021 13:21:39 +0100 schrieb Daniel P. Berrangé : > The challenge i see here is that of managing upgrades to the proposed > state. This is as easy as this for each modified file that was marked as %config(noreplace): %pre test -f /etc/sysconfig/file.rpmsave && mv -v "$_" "$_".old %posttrans test -f /etc/sysconfig/file.rpmsave && mv -v "$_" /etc/sysconfig/file Olaf pgpLju7bGU8Lq.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virtqemud: remove sysconfig file
Am Mon, 19 Jul 2021 09:55:37 +0100 schrieb Daniel P. Berrangé : > I don't see that would have made any change since --listen was not enabled > either before / after the changes. It was the default in the SUSE package. I should have checked libvirt.git if it has been used. > Originally the sysconfig file provided a way to override the initscripts > config, and was kept with systemd units essentially because it already > exists. Now that initscripts are completely gone, the sysconfig possibly > doesn't need to exist, as it is already posible to override unit files in > a reasonably simple manner. I have seen sysv scripts that do "test -f sysconfig/file && . $_", so in some sense sysconfig was already optional before. I have not checked if the sysv scripts from libvirt.git had such code. So, do you or anyone else agree to get rid of sysconfig files in libvirt.git and put the defaults provided by libvirt.git into the systemd unit files? Just as I proposed in my patch? If yes, should it be one monolithic change that touches also libvirt.spec and the NEWS file? Olaf pgpYPlOklyLia.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virtqemud: remove sysconfig file
Am Fri, 16 Jul 2021 00:58:43 -0700 schrieb Andrea Bolognani : > This arrangement appears to be very common, too: on my Fedora 34 > machine, /etc/sysconfig contains ~25 files, all owned by some package > and most consisting of at least one non-comment lines. Forgot to reply to this paragraph: None of the files in /etc have to be owned by a package. We are slowly getting there. /etc/sysconfig is not owned by any package, it is entirely maintained by the admin. Olaf pgpCHyS_Br75E.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] virtqemud: remove sysconfig file
Am Fri, 16 Jul 2021 00:58:43 -0700 schrieb Andrea Bolognani : > The sysconfig files shipped with libvirt contain the defaults, and > the admin is absolutely welcome to tweak them however they might like > after installation, just as is the case for all the configuration > files in /etc/libvirt. Right. Once they are modified for whatever reason things will go downhill. Just recently the default (for libvirtd) changed from --listen to --timeout. This is an incompatible change. There is very little info on the system to workout if the admin actually wanted --listen, and just append some other knob, or if he dirtied the sysconfig file in other ways. Therefore %post or %posttrans scripts have no easy way to decide what to do with the existing sysconfig file to switch to the new default. If --listen would have been configured like I proposed, any admin changes are clear and obvious, and he has to keep the pieces if it falls apart because some default changed. In this case from .service to .socket activation. Furthermore my change should also add every undocumented variable to the service file. Configuration files are not documentation files. This is also violated, but should probably be discussed on another Friday. Olaf pgpkBy7ESBGOA.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] virtqemud: remove sysconfig file
sysconfig files are owned by the admin of the host. He has the liberty to put anything he wants into these files. This makes it difficult to provide different defaults. Remove the sysconfig file and place the current desired default into the service file. Local customizations can now go either into /etc/sysconfig/virtqemud or /etc/systemd/system/virtqemud.service.d/my-knobs.conf Signed-off-by: Olaf Hering --- Untested, just to demonstrate how it could be done for every sysconfig file. libvirt.spec.in | 1 - src/qemu/meson.build | 5 - src/qemu/virtqemud.service.in | 1 + src/qemu/virtqemud.sysconf| 12 4 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 src/qemu/virtqemud.sysconf diff --git a/libvirt.spec.in b/libvirt.spec.in index cb48dd0be0..2cc3e61e3c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1689,7 +1689,6 @@ exit 0 %if %{with_qemu} %files daemon-driver-qemu -%config(noreplace) %{_sysconfdir}/sysconfig/virtqemud %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf %{_datadir}/augeas/lenses/virtqemud.aug %{_datadir}/augeas/lenses/tests/test_virtqemud.aug diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 3898d23877..6b4dd58309 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -165,11 +165,6 @@ if conf.has('WITH_QEMU') 'in_file': files('virtqemud.init.in'), } - sysconf_files += { -'name': 'virtqemud', -'file': files('virtqemud.sysconf'), - } - virt_install_dirs += [ localstatedir / 'lib' / 'libvirt' / 'qemu', runstatedir / 'libvirt' / 'qemu', diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in index 8abc9d3a7f..a5cb145668 100644 --- a/src/qemu/virtqemud.service.in +++ b/src/qemu/virtqemud.service.in @@ -18,6 +18,7 @@ Documentation=https://libvirt.org [Service] Type=notify +Environment=VIRTQEMUD_ARGS="--timeout 120" EnvironmentFile=-@sysconfdir@/sysconfig/virtqemud ExecStart=@sbindir@/virtqemud $VIRTQEMUD_ARGS ExecReload=/bin/kill -HUP $MAINPID diff --git a/src/qemu/virtqemud.sysconf b/src/qemu/virtqemud.sysconf deleted file mode 100644 index 87b626e3ed..00 --- a/src/qemu/virtqemud.sysconf +++ /dev/null @@ -1,12 +0,0 @@ -# Customizations for the virtqemud.service systemd unit - -VIRTQEMUD_ARGS="--timeout 120" - -# Override the QEMU/SDL default audio driver probing when -# starting virtual machines using SDL graphics -# -# NB these have no effect for VMs using VNC, unless vnc_allow_host_audio -# is enabled in /etc/libvirt/qemu.conf -#QEMU_AUDIO_DRV=sdl -# -#SDL_AUDIODRIVER=pulse
[PATCH v1] apparmor: Allow /usr/libexec for private xen-tools binaries
This is a followup for commit e906c4d02bdcddf141b4d124afd68c8ee10134fe ("apparmor: Allow /usr/libexec for libxl-save-helper and pygrub"): In recent rpm versions --libexecdir changed from /usr/lib64 to /usr/libexec. A plain rpmbuild %configure in xen.git will install all files, including the private copies of qemu, into /usr/libexec/xen/bin. Expand the existing pattern to cover also this libexecdir variant. Signed-off-by: Olaf Hering --- src/security/apparmor/usr.sbin.libvirtd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/apparmor/usr.sbin.libvirtd.in b/src/security/apparmor/usr.sbin.libvirtd.in index 928782b709..f2ab6ff2aa 100644 --- a/src/security/apparmor/usr.sbin.libvirtd.in +++ b/src/security/apparmor/usr.sbin.libvirtd.in @@ -88,7 +88,7 @@ profile libvirtd @sbindir@/libvirtd flags=(attach_disconnected) { @sbindir@/* PUx, /{usr/,}lib/udev/scsi_id PUx, /usr/{lib,lib64}/xen-common/bin/xen-toolstack PUx, - /usr/{lib,lib64}/xen/bin/* Ux, + /usr/{lib,lib64,libexec}/xen/bin/* Ux, /usr/{lib,libexec}/xen-*/bin/libxl-save-helper PUx, /usr/{lib,libexec}/xen-*/bin/pygrub PUx, /usr/{lib,lib64,lib/qemu,libexec}/vhost-user-gpu PUx,
crash in virQEMUCapsProbeQMPTPM
I got a couple of "g_strv_contains: assertion 'strv != NULL' failed" in the past days. It seems qemuMonitorGetTPMModels can write NULL into "models" in "virQEMUCapsProbeQMPTPM()". As a result g_strv_contains will crash with G_DEBUG=fatal-warnings This is libvirt.git#15073504db and qemu.git#13d5f87cc3 Olaf pgpsGttWttmGL.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH 0/2] Xen: Fallout from minimum supported version bump
Am Thu, 17 Jun 2021 14:30:27 -0600 schrieb Jim Fehlig : > Patch 1 removes the use of LIBXL_HAVE_* that are present in Xen >= 4.9. Thanks, this compiles for, and looks good to me. Olaf pgpsQtL1UiylY.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: fix xenstore and xentoollog detection
Am Wed, 16 Jun 2021 14:30:45 -0600 schrieb Jim Fehlig : > Opinions? I'm fine with that patch. Olaf pgp5cUqM_Fjad.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: fix xenstore and xentoollog detection
Am Mon, 14 Jun 2021 14:38:19 +0100 schrieb Daniel P. Berrangé : > Based on this policy, it is clear that the Xen minimum should be > 4.9 based on version information we can see for the distros. Just to wrap up here: The LIBXL_API_VERSION needs to stay at 4.5, because this is the only thing known by Xen 4.9. As a result no code can be removed. There are 4 LIBXL_HAVE_whatever knobs that appeared between Xen 4.6 and 4.9. As a result only a few lines of #ifdef/#endif could be removed, no actual code. So in my opinion it is not worth the effort, the patch for meson.build should be applied as it is. I will leave it to Jim what to do with it. Olaf pgpcXSz2AQsOC.pgp Description: Digitale Signatur von OpenPGP
set custom loglevel for external libraries
In src/libxl/libxl_conf.c:libxlDriverConfigInit, virLogGetDefaultPriority is used to specify the (private) loglevel of an external library. This value could be controlled via "log_level=N" in libvirtd.conf. But doing it that way will affect libvirtd itself, instead of libxenlight.so as intended. There might be ways to suppress everything but libxl output via "log_filters=", but it is not clear what the syntax would be. I wonder what the preferred way is to specify the desired loglevel for the external library. It seems a separate configuration setting is required so that each value of XTL_* from xentoollog.h can be specified. Olaf pgpDjJLIGdB5t.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: fix xenstore and xentoollog detection
Am Mon, 14 Jun 2021 11:06:51 +0100 schrieb Daniel P. Berrangé : > Repology reports the following Is it expected that people replace just "libvirt" on a system, and leave everything as it is? If I would build a Xen server, the obvious change is to also replace Xen with the variant I want or need. Well, and that is exactly what I do. For testing I have to run old variants of it, and I expect that libvirt can deal with it. Right now it does. I will be really disappointed if the base line is bumped for no good reason. "cc.find_library" has to be supported for other libraries anyway, so there is no downside to use it if "dependency" can not be used. How much libxl code could be removed, no idea. Without looking I say its likely not worth. Olaf pgp1hyxwgGurj.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: fix xenstore and xentoollog detection
Am Mon, 14 Jun 2021 11:54:56 +0200 schrieb Pavel Hrdina : > It matters in a way that we can bump the minimal version to 4.9 and we > can simplify the code a bit more. I will leave this up to Jim if such thing can be justified. It may not matter much for code in libxl. Olaf pgpVXP4K8mshY.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v1] meson: fix xenstore and xentoollog detection
Am Mon, 14 Jun 2021 11:13:54 +0200 schrieb Pavel Hrdina : > What OS that libvirt supports ships Xen < 4.9? I don't know if that matters. A few lines above in meson.build Xen 4.6 is the supported base. Olaf pgp7g1rZa_TUm.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] meson: fix xenstore and xentoollog detection
A xenstore.pc and xentoollog.pc exists only since Xen 4.9. Fixes commit fe7c07adac30994dd042515e1076e195128e15cd Signed-off-by: Olaf Hering --- meson.build | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 04c229d7f4..f3ff57d336 100644 --- a/meson.build +++ b/meson.build @@ -1500,14 +1500,22 @@ if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') endif xl_util_dep = dependency('xlutil') -xen_store_dep = dependency('xenstore') +# xenstore.pc exists since Xen 4.9 +if libxl_dep.version().version_compare('>=4.9.0') + xen_store_dep = dependency('xenstore') +else + xen_store_dep = cc.find_library('xenstore') +endif # xtl_* infrastructure is in libxentoollog since Xen 4.7 previously # it was in libxenctrl. -if libxl_dep.version().version_compare('>=4.7.0') +# xentoollog.pc exists since Xen 4.9 +if libxl_dep.version().version_compare('>=4.9.0') xtl_link_dep = dependency('xentoollog') +elif libxl_dep.version().version_compare('>=4.7.0') + xtl_link_dep = cc.find_library('xentoollog') else - xtl_link_dep = dependency('xenctrl') + xtl_link_dep = cc.find_library('xenctrl') endif if libxl_dep.version().version_compare('>=4.13.0')
Re: [PATCH V5] libxl: adjust handling of libxl_device_nic objects
Am Wed, 26 May 2021 14:13:23 -0600 schrieb Jim Fehlig : > Adjust libxlMakeNicList to initialize the list of objects, before they > are filled by libxlMakeNic. The libxl_domain_config object passed to > libxlMakeNicList is owned by the caller and will be disposed with > libxl_domain_config_dispose, which also disposes embedded objects such > as libxl_device_nic. > > Signed-off-by: Jim Fehlig Acked-by: Olaf Hering Olaf pgpJ5H4I2Zh6Y.pgp Description: Digitale Signatur von OpenPGP
Re: [PATCH v4] libxl: adjust handling of libxl_device_nic objects
Am Tue, 25 May 2021 23:40:59 +0200 schrieb Olaf Hering : > In case of error the objects are disposed by libxl_domain_config_dispose. I just realized this is not always true, unless this change is applied on top. If libxlMakeNic fails, libxl_domain_config_dispose can not release anything. With this additional change each successfully initialized object can be fully disposed. Olaf --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1523,13 +1523,14 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) libxl_device_nic *x_nics; size_t i, nvnics = 0; -x_nics = g_new0(libxl_device_nic, nnics); +d_config->nics = x_nics = g_new0(libxl_device_nic, nnics); for (i = 0; i < nnics; i++) { if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV) continue; libxl_device_nic_init(_nics[nvnics]); +d_config->num_nics = nvnics + 1; if (libxlMakeNic(def, l_nics[i], _nics[nvnics], false)) return -1; /* @@ -1544,8 +1545,6 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) } VIR_SHRINK_N(x_nics, nnics, nnics - nvnics); -d_config->nics = x_nics; -d_config->num_nics = nvnics; return 0; } pgp2mzaQmza8D.pgp Description: Digitale Signatur von OpenPGP
[PATCH v4] libxl: adjust handling of libxl_device_nic objects
libxl objects are supposed to be initialized and disposed. Adjust libxlMakeNic to use an already initialized object, it is owned by the caller. Adjust libxlMakeNicList to initialize the list of objects, before they are filled by libxlMakeNic. In case of error the objects are disposed by libxl_domain_config_dispose. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 2ecbcf6911..c672bafbe9 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1335,8 +1335,6 @@ libxlMakeNic(virDomainDef *def, return -1; } -libxl_device_nic_init(x_nic); - virMacAddrGetRaw(_nic->mac, x_nic->mac); /* @@ -1531,8 +1529,9 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV) continue; +libxl_device_nic_init(_nics[nvnics]); if (libxlMakeNic(def, l_nics[i], _nics[nvnics], false)) -goto error; +return -1; /* * The devid (at least right now) will not get initialized by * libxl in the setup case but is required for starting the @@ -1549,12 +1548,6 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) d_config->num_nics = nvnics; return 0; - - error: -for (i = 0; i < nnics; i++) -libxl_device_nic_dispose(_nics[i]); -VIR_FREE(x_nics); -return -1; } int
Re: [PATCH v3] libxl: adjust handling of libxl_device_nic objects
Am Fri, 21 May 2021 10:49:15 -0600 schrieb Jim Fehlig : > There's actually a subtle bug with this logic change. Well, the devid index number used to depend on "nnics", now it would depend on "nvnics". That might be an incompatible change indeed. Olaf pgpsGmVto0jvm.pgp Description: Digitale Signatur von OpenPGP
[PATCH v1] libxl: remove libxl_domain_build_info_init from libxlMakeDomBuildInfo
The used libxl_domain_build_info, which is contained in libxl_domain_config, is owned and already initialized by the caller. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 1fd0322b6a..3598ca395d 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -346,8 +346,6 @@ libxlMakeDomBuildInfo(virDomainDef *def, size_t i; size_t nusbdevice = 0; -libxl_domain_build_info_init(b_info); - if (hvm) { libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM); } else if (pvh) {
[PATCH v1] libxl: remove libxl_domain_create_info_init from libxlMakeDomCreateInfo
The passed libxl_domain_create_info is owned, and already initialized, by the caller. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 8dc7e26cea..1fd0322b6a 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -129,8 +129,6 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx, { char uuidstr[VIR_UUID_STRING_BUFLEN]; -libxl_domain_create_info_init(c_info); - if (def->os.type == VIR_DOMAIN_OSTYPE_HVM || def->os.type == VIR_DOMAIN_OSTYPE_XENPVH) { #ifdef WITH_XEN_PVH
[PATCH v3] libxl: adjust handling of libxl_device_nic objects
libxl objects are supposed to be initialized and disposed. Adjust libxlMakeNic to use an already initialized object, it is owned by the caller. Adjust libxlMakeNicList to initialize the list of objects, before they are filled by libxlMakeNic. In case of error the objects are disposed by libxl_domain_config_dispose. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index f29a28a841..8dc7e26cea 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1339,8 +1339,6 @@ libxlMakeNic(virDomainDef *def, return -1; } -libxl_device_nic_init(x_nic); - virMacAddrGetRaw(_nic->mac, x_nic->mac); /* @@ -1526,39 +1524,33 @@ libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) { virDomainNetDef **l_nics = def->nets; size_t nnics = def->nnets; -libxl_device_nic *x_nics; size_t i, nvnics = 0; -x_nics = g_new0(libxl_device_nic, nnics); - for (i = 0; i < nnics; i++) { if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV) continue; +nvnics++; +} +if (!nvnics) +return 0; -if (libxlMakeNic(def, l_nics[i], _nics[nvnics], false)) -goto error; +d_config->nics = g_new0(libxl_device_nic, nvnics); +d_config->num_nics = nvnics; + +for (i = 0; i < nvnics; i++) { +libxl_device_nic_init(_config->nics[i]); +if (libxlMakeNic(def, l_nics[i], _config->nics[i], false)) +return -1; /* * The devid (at least right now) will not get initialized by * libxl in the setup case but is required for starting the * device-model. */ -if (x_nics[nvnics].devid < 0) -x_nics[nvnics].devid = nvnics; - -nvnics++; +if (d_config->nics[i].devid < 0) +d_config->nics[i].devid = i; } -VIR_SHRINK_N(x_nics, nnics, nnics - nvnics); -d_config->nics = x_nics; -d_config->num_nics = nvnics; - return 0; - - error: -for (i = 0; i < nnics; i++) -libxl_device_nic_dispose(_nics[i]); -VIR_FREE(x_nics); -return -1; } int
[PATCH v2] libxl: adjust handling of libxl_device_disk objects
libxl objects are supposed to be initialized and disposed. Correct the usage of libxl_device_disk objects which are allocated on the stack. Initialize each one prior usage, and dispose them once done. Adjust libxlMakeDisk to use an already initialized object, it is owned by the caller. Adjust libxlMakeDiskList to initialize the list of objects, before they are filled by libxlMakeDisk. In case of error, the objects are disposed by libxl_domain_config_dispose. Signed-off-by: Olaf Hering --- src/libxl/libxl_conf.c | 20 +--- src/libxl/libxl_driver.c | 6 ++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 3149ee3b4a..f29a28a841 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1114,8 +1114,6 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) int format = virDomainDiskGetFormat(l_disk); int actual_type = virStorageSourceGetActualType(l_disk->src); -libxl_device_disk_init(x_disk); - if (actual_type == VIR_STORAGE_TYPE_NETWORK) { if (STRNEQ_NULLABLE(driver, "qemu")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1265,26 +1263,18 @@ libxlMakeDiskList(virDomainDef *def, libxl_domain_config *d_config) { virDomainDiskDef **l_disks = def->disks; int ndisks = def->ndisks; -libxl_device_disk *x_disks; size_t i; -x_disks = g_new0(libxl_device_disk, ndisks); +d_config->disks = g_new0(libxl_device_disk, ndisks); +d_config->num_disks = ndisks; for (i = 0; i < ndisks; i++) { -if (libxlMakeDisk(l_disks[i], _disks[i]) < 0) -goto error; +libxl_device_disk_init(_config->disks[i]); +if (libxlMakeDisk(l_disks[i], _config->disks[i]) < 0) +return -1; } -d_config->disks = x_disks; -d_config->num_disks = ndisks; - return 0; - - error: -for (i = 0; i < ndisks; i++) -libxl_device_disk_dispose(_disks[i]); -VIR_FREE(x_disks); -return -1; } /* diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index d54cd41785..2b844bb3b5 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2978,6 +2978,7 @@ libxlDomainChangeEjectableMedia(virDomainObj *vm, virDomainDiskDef *disk) size_t i; int ret = -1; +libxl_device_disk_init(_disk); for (i = 0; i < vm->def->ndisks; i++) { if (vm->def->disks[i]->bus == disk->bus && STREQ(vm->def->disks[i]->dst, disk->dst)) { @@ -3018,6 +3019,7 @@ libxlDomainChangeEjectableMedia(virDomainObj *vm, virDomainDiskDef *disk) ret = 0; cleanup: +libxl_device_disk_dispose(_disk); virObjectUnref(cfg); return ret; } @@ -3030,6 +3032,7 @@ libxlDomainAttachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) libxl_device_disk x_disk; int ret = -1; +libxl_device_disk_init(_disk); switch (l_disk->device) { case VIR_DOMAIN_DISK_DEVICE_CDROM: ret = libxlDomainChangeEjectableMedia(vm, l_disk); @@ -3091,6 +3094,7 @@ libxlDomainAttachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) } cleanup: +libxl_device_disk_dispose(_disk); virObjectUnref(cfg); return ret; } @@ -3329,6 +,7 @@ libxlDomainDetachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) int idx; int ret = -1; +libxl_device_disk_init(_disk); switch (dev->data.disk->device) { case VIR_DOMAIN_DISK_DEVICE_DISK: if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_XEN) { @@ -3380,6 +3385,7 @@ libxlDomainDetachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) } cleanup: +libxl_device_disk_dispose(_disk); virObjectUnref(cfg); return ret; }