libvirt/tools
Benjamin Taubmann a39dd25715 Extend libvirt-guests to shutdown only persistent VMs
At the moment, there is no configuration option for the libvirt-guests
service that allows users to define that only persistent virtual machines
should be shutdown on host shutdown.

Currently, the service config allows to choose between two ON_SHUTDOWN
actions that are executed on running virtual machines when the host goes
down: shutdown, suspend.
The ON_SHUTDOWN action should be orthogonal to the type of the virtual
machine. However, the existing implementation, does not suspend
transient virtual machines.
This is the matrix of actions that is executed on virtual machines based
on the configured ON_SHUTDOWN action and the type of a virtual machine.

         | persistent | transient
shutdown | shutdown   | shutdown (what we want to change)
suspend  | suspend    | nothing

Add config option PERSISTENT_ONLY to libvirt-guests config that allows
users to define if the ON_SHUTDOWN action should be applied only on
persistent virtual machines. PERSISTENT_ONLY can be set to true, false,
default. The default option will implement the already existing logic.

Case 1: PERSISTENT_ONLY=default
         | persistent | transient
shutdown | shutdown   | shutdown
suspend  | suspend    | nothing

Case 2: PERSISTENT_ONLY=true
         | persistent | transient
shutdown | shutdown   | nothing
suspend  | suspend    | nothing

Case 3: PERSISTENT_ONLY=false
         | persistent | transient
shutdown | shutdown   | shutdown
suspend  | suspend    | suspend

Signed-off-by: Benjamin Taubmann <benjamin.taubmann@nutanix.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-04-04 09:10:00 +02:00
..
bash-completion
nss syntax-check: Forbid use of qsort() 2023-11-24 09:53:14 +01:00
wireshark meson: Replace meson.source_root() with meson.project_source_root() 2022-10-10 15:06:09 +02:00
libvirt_recover_xattrs.sh
libvirt_win_icon_16x16.ico
libvirt_win_icon_32x32.ico
libvirt_win_icon_48x48.ico
libvirt_win_icon_64x64.ico
libvirt-guests.service.in systemd: More tweaks to Description and Documentation lines 2023-11-06 23:45:04 +01:00
libvirt-guests.sh.in Extend libvirt-guests to shutdown only persistent VMs 2024-04-04 09:10:00 +02:00
meson.build tests: Re-implement '(virsh|virt-admin)-self-test' directly in meson 2024-04-02 14:24:30 +02:00
virsh_win_icon.rc
virsh-backup.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-backup.h
virsh-checkpoint.c virsh: Fix '--name' and '--parent' used together in '(snapshot|checkpoint)-list' command 2024-04-02 14:24:30 +02:00
virsh-checkpoint.h
virsh-completer-checkpoint.c
virsh-completer-checkpoint.h
virsh-completer-domain.c virsh: Command completion, add comp-methods with zlib and zstd 2024-01-11 13:15:08 +01:00
virsh-completer-domain.h
virsh-completer-host.c virsh: Add completer for hypervisor-cpu-baseline --model 2022-10-10 14:31:43 +02:00
virsh-completer-host.h virsh: Add completer for hypervisor-cpu-baseline --model 2022-10-10 14:31:43 +02:00
virsh-completer-interface.c
virsh-completer-interface.h
virsh-completer-network.c
virsh-completer-network.h
virsh-completer-nodedev.c conf: move/rename hostdev PCI driver type enum to device_conf.h 2024-01-07 23:57:09 -05:00
virsh-completer-nodedev.h
virsh-completer-nwfilter.c
virsh-completer-nwfilter.h
virsh-completer-pool.c virsh-completer: modify and fix bug in virshPoolTypeCompleter, now used for more commands 2024-02-20 12:08:22 +01:00
virsh-completer-pool.h virsh-completer: modify and fix bug in virshPoolTypeCompleter, now used for more commands 2024-02-20 12:08:22 +01:00
virsh-completer-secret.c
virsh-completer-secret.h
virsh-completer-snapshot.c
virsh-completer-snapshot.h
virsh-completer-volume.c
virsh-completer-volume.h
virsh-completer.c
virsh-completer.h
virsh-console.c virsh: Show 'connected to console' message later 2024-04-02 18:26:35 +02:00
virsh-console.h virsh: add console --resume support 2023-10-24 13:51:32 +02:00
virsh-domain-event.c virsh: Annodate 'unwanted_positional' arguments 2024-04-02 14:24:30 +02:00
virsh-domain-event.h
virsh-domain-monitor.c vshCmdOptDef: Remove unused 'flags' member 2024-04-02 14:24:30 +02:00
virsh-domain-monitor.h
virsh-domain.c virsh: Show 'connected to console' message later 2024-04-02 18:26:35 +02:00
virsh-domain.h
virsh-edit.c tools: Update format strings in translated messages (part 1) 2023-04-01 11:40:35 +02:00
virsh-host.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-host.h
virsh-interface.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-interface.h
virsh-network.c vshCmdOptDef: Remove unused 'flags' member 2024-04-02 14:24:30 +02:00
virsh-network.h
virsh-nodedev.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-nodedev.h
virsh-nwfilter.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-nwfilter.h
virsh-pool.c vshCmdOptDef: Remove unused 'flags' member 2024-04-02 14:24:30 +02:00
virsh-pool.h
virsh-secret.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-secret.h
virsh-snapshot.c virsh: Fix '--name' and '--parent' used together in '(snapshot|checkpoint)-list' command 2024-04-02 14:24:30 +02:00
virsh-snapshot.h
virsh-util.c lib: Replace xmlKeepBlanksDefault() with virXMLParseWithIndent() 2023-11-21 14:43:39 +01:00
virsh-util.h virsh exposure of Network Metadata APIs 2023-08-25 12:36:37 +02:00
virsh-volume.c vsh: Make positional parsing of arguments opt-in 2024-04-02 14:24:30 +02:00
virsh-volume.h
virsh.c vsh: Replace 'VSH_OFLAG_EMPTY_OK' bitwise flag with a separate struct member 2024-04-02 14:24:30 +02:00
virsh.h virsh: Inline VIRSH_COMMON_OPT_FILE_FULL macro 2024-04-02 14:24:29 +02:00
virt-admin-completer.c
virt-admin-completer.h
virt-admin.c vsh: Replace 'VSH_OFLAG_EMPTY_OK' bitwise flag with a separate struct member 2024-04-02 14:24:30 +02:00
virt-admin.h
virt-host-validate-bhyve.c virHostValidateBhyve: Heap allocate massive 'struct kld_file_stat' 2023-09-04 10:31:53 +02:00
virt-host-validate-bhyve.h
virt-host-validate-ch.c tools: Move error messages onto a single line 2023-09-04 09:35:36 +02:00
virt-host-validate-ch.h
virt-host-validate-common.c virt-host-validate: Detect SMMU presence on ARMs by parsing IORT table 2023-04-06 12:48:22 +02:00
virt-host-validate-common.h
virt-host-validate-lxc.c
virt-host-validate-lxc.h
virt-host-validate-qemu.c tools: Move error messages onto a single line 2023-09-04 09:35:36 +02:00
virt-host-validate-qemu.h
virt-host-validate.c tools: Update format strings in translated messages (part 2) 2023-04-01 11:40:36 +02:00
virt-login-shell-helper.c tools: Update format strings in translated messages (part 2) 2023-04-01 11:40:36 +02:00
virt-login-shell.c Use G_N_ELEMENTS() more 2023-03-13 13:29:07 +01:00
virt-login-shell.conf
virt-pki-query-dn.c tools: Update format strings in translated messages (part 2) 2023-04-01 11:40:36 +02:00
virt-pki-validate.in meson: Use initconfdir 2023-05-05 15:08:25 +02:00
virt-qemu-qmp-proxy scripts: Fix the flake8 syntax-check failures 2023-06-29 11:51:27 +02:00
virt-qemu-sev-validate vir-qemu-sev-validate: Use string() method in xpath 2023-12-05 12:21:38 +01:00
virt-sanlock-cleanup.in
virt-xml-validate.in
vsh-table.c lib: use struct zero initializer instead of memset 2023-08-03 16:41:19 +02:00
vsh-table.h
vsh.c vsh: Allow non-interactive use of 'cd' command 2024-04-02 14:24:30 +02:00
vsh.h vshCmdOptDef: Remove unused 'flags' member 2024-04-02 14:24:30 +02:00