Description of problem: When set to shutdown guests, the libvirt-guest service shuts down the guests but then ignores the successful shutdown and tries to shut down them again and again, until timeout is reached. Version-Release number of selected component (if applicable): 4.1.0.2-fc28 How reproducible: , Steps to Reproduce: 1. Enable libvirt-guests. 2. In /etc/sysconfig/libvirt-guests set ON_SHUTDOWN=shutdown. 3. start virtual machine. 4. shut down host. Actual results: libvirt-guests.sh shut down the guest successfully and then loops with the following messages: Starting shutdown on guest: guestname error: Requested operation is not valid: domain is not running error: Failed to shutdown domain guest-UID Expected results: After successfully shutting down the guest libvirt-guests.sh should quit gracefully. Additional info: Started after upgrading to 28. Reproduced on a different, newly installed system.
Created attachment 1496663 [details] Patch to fix the issue After two hours of "print debugging" I found out the check_guests_shutdown() function overwrites the global $guests variable. D'oh! I've developed a fix and wanted to send it upstream... just to notice it has already been fixed :) Attached is the upstream fix from git, it applies to libvirt from Fedora 28 just fine. *** Patch description *** commit 7e476356c28a7fccd40eebbd8dac83e49e782010 Author: Christian Ehrhardt <christian.ehrhardt> Date: Mon Mar 19 12:44:31 2018 +0100 tools: fix variable scope in in check_guests_shutdown libvirt-guests.sh when run with more active guests than requested to shut down in parallel will run until it times out only shutting down the first set of guests. This patch fixes parallel shutdown by fixing a variable scope issue where check_guests_shutdown unintentionally reset $guests which prevented further progress. Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1688508 Signed-off-by: Christian Ehrhardt <christian.ehrhardt>
Created attachment 1496665 [details] Second part of the fix Second part of the fix as done by upstream. My fix was simpler: Just declare the "$guests" variable as "local" in check_guests_shutdown().
This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '28'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 28 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
*** Bug 1590653 has been marked as a duplicate of this bug. ***
*** Bug 1597420 has been marked as a duplicate of this bug. ***
Sorry this slipped through the cracks and didn't get backported to F28. This is fixed in f29+