
On Thu, Jul 03, 2025 at 02:50:28PM +0200, Peter Krempa via Devel wrote:
From: Peter Krempa <pkrempa@redhat.com>
The existing dependency order of the 'machined' unit file for the domain we're starting ("After libvirtd/virtqemud"->thus shuts down *before* the daemon) is intended to work with 'libvirt-guests.service' which requires the daemon to be around to shut down the VMs.
If we want to use the integrated auto shutdown done by the daemon itself we need to be able to instruct the domains (thus the corresponding machined units to shut down *after* virtqemud/libvirt.
This means that we need to be able to invert the ordering relationship to "Before".
This patch adds a parameter to virSystemdCreateMachine so that when starting the VM we'll be able to tell the daemon to use the proper relationship.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/util/vircgroup.c | 3 ++- src/util/virsystemd.c | 27 +++++++++++++++++++++------ src/util/virsystemd.h | 3 ++- tests/virsystemdtest.c | 15 +++++++++------ 4 files changed, 34 insertions(+), 14 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>