[libvirt PATCH] logging: lockdown the systemd service configuration

2023-09-26 Thread Daniel P . Berrangé
The 'systemd-analyze security' command looks at the unit file configuration and reports on any settings which increase the attack surface for the daemon. Since most systemd units are fairly minimalist, this is generally informing us about settings that we never put any thought into using before. I

Re: [libvirt PATCH 0/2] Add vdpablock and nbdkit to NEWS

2023-09-26 Thread Jonathon Jongsma
On 9/19/23 3:47 PM, Jonathon Jongsma wrote: Jonathon Jongsma (2): news: document support for vdpa block devices news: document nbdkit support for network disks NEWS.rst | 18 ++ 1 file changed, 18 insertions(+) ping

Re: [libvirt PATCH v2] util: fix success return for virProcessKillPainfullyDelay()

2023-09-26 Thread Ján Tomko
On a Monday in 2023, Jonathon Jongsma wrote: virProcessKillPainfullyDelay() currently almost always returns 1 or -1, even though the documentation indicates that it should return 0 if the process was terminated gracefully. But the computation of the return code is faulty and the only case that it

Re: [PATCH] test: Fix testNodeGetFreePages

2023-09-26 Thread Ján Tomko
On a Tuesday in 2023, Martin Kletzander wrote: The function is supposed to return the number of items filled into the array and not zero. Also change the initialization of the "randomness" to be based on the startCell so that the values are different for each cell even for separate calls. Signe

Re: [PATCH] test: Fix testNodeGetFreePages

2023-09-26 Thread Michal Prívozník
On 9/26/23 14:20, Martin Kletzander wrote: > The function is supposed to return the number of items filled into the > array and not zero. Also change the initialization of the "randomness" > to be based on the startCell so that the values are different for each > cell even for separate calls. > >

[PATCH] virsh: Account for return values in virNodeGetFreePages

2023-09-26 Thread Martin Kletzander
The function returns how many array items were filled in, but virsh never checked for anything other than errors. Just to make sure this does not report invalid data, even though the only possibility would be reporting 0 free pages, check the returned data so that possible errors are detected. Si

Re: [PATCH] test: Fix testNodeGetFreePages

2023-09-26 Thread Martin Kletzander
On Tue, Sep 26, 2023 at 02:20:43PM +0200, Martin Kletzander wrote: The function is supposed to return the number of items filled into the array and not zero. Also change the initialization of the "randomness" to be based on the startCell so that the values are different for each cell even for se

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 01:14:33PM +0100, Daniel P. Berrangé wrote: > On Tue, Sep 26, 2023 at 07:02:19AM -0500, Andrea Bolognani wrote: > > I don't think it helps much with not storing additional data inside > > the build system, unless we want to store the contents of the various > > common snippe

Re: [libvirt PATCH v3 00/10] external snapshot revert fixes

2023-09-26 Thread Peter Krempa
On Mon, Sep 18, 2023 at 15:29:17 +0200, Pavel Hrdina wrote: > This fixes reverting external snapshots to not error out in cases where > it should work and makes it correctly load the memory state when > reverting to snapshot of running VM. > > This discards v2 completely and makes changes to v1: >

Re: [libvirt PATCH v3 06/10] qemuProcessStartWithMemoryState: make it possible to use without data

2023-09-26 Thread Peter Krempa
On Mon, Sep 18, 2023 at 15:29:23 +0200, Pavel Hrdina wrote: > When used with internal snapshots there is no memory state file so we > have no data to load and decompression is not needed. > > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_process.c | 23 +-- > 1 file chang

Re: [libvirt PATCH 35/42] systemd: Replace Requires with BindTo+After for sockets

2023-09-26 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 01:36:39PM +0100, Daniel P. Berrangé wrote: > On Tue, Sep 26, 2023 at 04:09:17AM -0500, Andrea Bolognani wrote: > > On Tue, Sep 26, 2023 at 09:44:52AM +0100, Daniel P. Berrangé wrote: > > > On Mon, Sep 25, 2023 at 08:58:33PM +0200, Andrea Bolognani wrote: > > > > This is the

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 08:12:43AM -0500, Andrea Bolognani wrote: > On Tue, Sep 26, 2023 at 01:14:33PM +0100, Daniel P. Berrangé wrote: > > On Tue, Sep 26, 2023 at 07:02:19AM -0500, Andrea Bolognani wrote: > > > I don't think it helps much with not storing additional data inside > > > the build sys

Re: [libvirt PATCH 35/42] systemd: Replace Requires with BindTo+After for sockets

2023-09-26 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 04:09:17AM -0500, Andrea Bolognani wrote: > On Tue, Sep 26, 2023 at 09:44:52AM +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 25, 2023 at 08:58:33PM +0200, Andrea Bolognani wrote: > > > This is the strongest relationship that can be declared between > > > two units, and ca

Re: [libvirt PATCH v3 05/10] qemuProcessStartWithMemoryState: add snapshot argument

2023-09-26 Thread Peter Krempa
On Mon, Sep 18, 2023 at 15:29:22 +0200, Pavel Hrdina wrote: > When called from snapshot code we will need to pass snapshot object in > order to make internal snapshots work correctly. > > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_process.c | 9 - > src/qemu/qemu_process.h | 1

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 11:23:51AM +0100, Daniel P. Berrangé wrote: > On Tue, Sep 26, 2023 at 11:09:44AM +0200, Pavel Hrdina wrote: > > On Mon, Sep 25, 2023 at 08:58:24PM +0200, Andrea Bolognani wrote: > > > +'service_unit_extra': [ > > > + 'Wants=systemd-machined.service', > > > + 'A

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 07:02:19AM -0500, Andrea Bolognani wrote: > On Tue, Sep 26, 2023 at 11:23:51AM +0100, Daniel P. Berrangé wrote: > > On Tue, Sep 26, 2023 at 11:09:44AM +0200, Pavel Hrdina wrote: > > > On Mon, Sep 25, 2023 at 08:58:24PM +0200, Andrea Bolognani wrote: > > > > +'service_uni

[PATCH] test: Fix testNodeGetFreePages

2023-09-26 Thread Martin Kletzander
The function is supposed to return the number of items filled into the array and not zero. Also change the initialization of the "randomness" to be based on the startCell so that the values are different for each cell even for separate calls. Signed-off-by: Martin Kletzander --- src/test/test_d

Re: [RFC PATCH libvirt v1 2/3] Improve `virsh start --console` behavior

2023-09-26 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 02:11:37PM +0200, Marc Hartmayer wrote: > On Mon, Sep 25, 2023 at 04:15 PM +0100, Daniel P. Berrangé > wrote: > > On Mon, Sep 25, 2023 at 03:39:09PM +0200, Marc Hartmayer wrote: > >> When starting a guest via libvirt (`virsh start --console`), early > >> console output was

Re: [RFC PATCH libvirt v1 2/3] Improve `virsh start --console` behavior

2023-09-26 Thread Marc Hartmayer
On Mon, Sep 25, 2023 at 04:15 PM +0100, Daniel P. Berrangé wrote: > On Mon, Sep 25, 2023 at 03:39:09PM +0200, Marc Hartmayer wrote: >> When starting a guest via libvirt (`virsh start --console`), early >> console output was missed because the guest was started first and then >> the console was at

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Daniel P . Berrangé
On Tue, Sep 26, 2023 at 11:09:44AM +0200, Pavel Hrdina wrote: > On Mon, Sep 25, 2023 at 08:58:24PM +0200, Andrea Bolognani wrote: > > Signed-off-by: Andrea Bolognani > > --- > > src/ch/meson.build| 27 > > src/ch/virtchd.service.in | 44 ---

Entering freeze for libvirt-9.8.0

2023-09-26 Thread Jiri Denemark
I have just tagged v9.8.0-rc1 in the repository and pushed signed tarballs and source RPMs to https://download.libvirt.org/ Please give the release candidate some testing and in case you find a serious issue which should have a fix in the upcoming release, feel free to reply to this thread to make

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 11:09:44AM +0200, Pavel Hrdina wrote: > On Mon, Sep 25, 2023 at 08:58:24PM +0200, Andrea Bolognani wrote: > > +'service_unit_extra': [ > > + 'Wants=systemd-machined.service', > > + 'After=systemd-machined.service', > > + 'After=remote-fs.target', > > +

Re: [libvirt PATCH 35/42] systemd: Replace Requires with BindTo+After for sockets

2023-09-26 Thread Andrea Bolognani
On Tue, Sep 26, 2023 at 09:44:52AM +0100, Daniel P. Berrangé wrote: > On Mon, Sep 25, 2023 at 08:58:33PM +0200, Andrea Bolognani wrote: > > This is the strongest relationship that can be declared between > > two units, and causes the service to be terminated immediately > > if any of its sockets di

Re: [libvirt PATCH 26/42] systemd: Switch virtchd to common templates

2023-09-26 Thread Pavel Hrdina
On Mon, Sep 25, 2023 at 08:58:24PM +0200, Andrea Bolognani wrote: > Signed-off-by: Andrea Bolognani > --- > src/ch/meson.build| 27 > src/ch/virtchd.service.in | 44 --- > 2 files changed, 23 insertions(+), 48 deletions(-) > de

Re: [libvirt PATCH 12/42] systemd: Make @service_in@ optional

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:10PM +0200, Andrea Bolognani wrote: > It is currently considered required, but we're soon going to > provide a default that will be suitable for most services. > > Since all services currently provide a value explicitly, we > can implement a default without breaking a

Re: [libvirt PATCH 35/42] systemd: Replace Requires with BindTo+After for sockets

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:33PM +0200, Andrea Bolognani wrote: > This is the strongest relationship that can be declared between > two units, and causes the service to be terminated immediately > if any of its sockets disappear. This is the behavior we want. IIUC, this prevents running the serv

Re: [libvirt PATCH 09/42] systemd: Drop unnecessary uses of @sockets@

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:07PM +0200, Andrea Bolognani wrote: > For most services, the value provided explicitly matches the > documented default. > > Signed-off-by: Andrea Bolognani > --- > src/ch/meson.build | 1 - > src/interface/meson.build | 1 - > src/libxl/meson.build

Re: [libvirt PATCH 10/42] systemd: Make @sockprefix@ optional

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:08PM +0200, Andrea Bolognani wrote: > For most services, the socket paths can be derived trivially from > the name of the daemon: for virtqemud, for example, they will be > > /run/libvirt/virtqemud-sock > /run/libvirt/virtqemud-sock-ro > /run/libvirt/virtqemud-a

Re: [libvirt PATCH 11/42] systemd: Drop unnecessary uses of @sockprefix@

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:09PM +0200, Andrea Bolognani wrote: > Now that providing the value is optional, we can remove almost > all uses. > > Signed-off-by: Andrea Bolognani > --- > src/ch/meson.build | 1 - > src/interface/meson.build | 1 - > src/libxl/meson.build | 1 - >

Re: [libvirt PATCH 02/42] systemd: Add missing WantedBy for virtlogd/virtlockd

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:00PM +0200, Andrea Bolognani wrote: > This annotation being missing resulted in virtlogd and virtlockd > being marked as "indirect" services, i.e. services that cannot > be started directly but have to be socket activated instead. > > While this is our preferred confi

Re: [libvirt PATCH 04/42] systemd: Set Type=notify for virtlogd/virtlockd

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:02PM +0200, Andrea Bolognani wrote: > This tells systemd that the services in question support the > native socket activation protocol. > > virtlogd and virtlockd, just like all the other daemons, implement > the necessary handshake. > > Signed-off-by: Andrea Bologna

Re: [libvirt PATCH 07/42] systemd: Rename @mode@ -> @sockmode@

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:05PM +0200, Andrea Bolognani wrote: > Signed-off-by: Andrea Bolognani > --- > src/meson.build | 6 +++--- > src/remote/libvirtd.socket.in | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Daniel P. Berrangé With regards, Daniel

Re: [libvirt PATCH 08/42] systemd: Only set @sockmode@ once

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:06PM +0200, Andrea Bolognani wrote: > The decision is based only on whether Polkit support is enabled, > so there's no need to go through it again for every single > service. > > Signed-off-by: Andrea Bolognani > --- > src/meson.build | 12 ++-- > 1 file cha

Re: [libvirt PATCH 06/42] systemd: Rename socket_in_def -> socket_in_default

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:04PM +0200, Andrea Bolognani wrote: > The meaning of the _def suffix might not be immediately obvious, > especially since it's also used to refer to the output of the > meson-gen-def.py script elsewhere in the same file. > > Signed-off-by: Andrea Bolognani > --- > s

Re: [libvirt PATCH 05/42] systemd: Set @name@ for virtlogd/virtlockd

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:03PM +0200, Andrea Bolognani wrote: > The information is not used anywhere right now, but the > documentation for virt_daemon_units claims it's mandatory. > > More importantly, we're going to start actually using it later > on. > > Signed-off-by: Andrea Bolognani >

Re: [libvirt PATCH 01/42] systemd: Add missing Also for admin socket

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:57:59PM +0200, Andrea Bolognani wrote: > When libvirtd, virtlog and virtlockd are enabled, we want their > admin sockets to be enabled as well. s/enabled/enabled for socket activation/ because these admin sockets were enabled automatically when the service eventually st

Re: [libvirt PATCH 03/42] systemd: Add missing Service for virtlogd/virtlockd

2023-09-26 Thread Daniel P . Berrangé
On Mon, Sep 25, 2023 at 08:58:01PM +0200, Andrea Bolognani wrote: > While systemd will automatically match foo.socket with foo.service > based on their names, it's nicer to connect the two explicitly. > > This is what we do for all services, with virtlogd and virtlockd > being the only exceptions.