mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
ab5b5f22b9
In libvirt 6.6 stopping guests with libvirt-guests.sh is broken. As soon as there is more than one guest one can see `systemctl stop libvirt-guests` failing and in the log we see: libvirt-guests.sh[2455]: Running guests on default URI: libvirt-guests.sh[2457]: /usr/lib/libvirt/libvirt-guests.sh: 120: local: 2a49cb0f-1ff8-44b5-a61d-806b9e52dae2: bad variable name libvirt-guests.sh[2462]: no running guests. That is due do mutliple guests becoming a list of UUIDs. Without recognizing this as one single string the assignment breaks when using 'local' (which was recently added in 6.3.0). This is because local is defined as local [option] [name[=value] ... | - ] which makes the shell trying handle the further part of the string as variable names. In the error above that string isn't a valid variable name triggering the issue that is seen. This depends on the shell being used. POSIX shells don't have 'local' specified yet and for the common shells it depends. It worked in bash and bash-in-POSIX-mode, but for example dash in POSIX mode triggers the issue. To resolve that 'textify' all assignments that are strings or potentially can become such lists (even if they are not using the local qualifier). Fixes: 08071ec0 "tools: variables clean-up in libvirt-guests script" Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>