This commit makes sure that the Python list vms_list is not mutated
while the code is iterating through it. To the best of my knowledge,
this is a problematic operation.
To rectify this issue, a new temporary list is instantiated, and
the VM objects that have shut down are appended to the temporary list,
which is afterwards used to remove the shut-down VM objects from the
vms_list.
Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
Prior to this commit, qvm-shutdown had a limitation where only one
VM name could be passed in via the command line for shutting down.
This commit removes the aforementioned limitation by adapting the
code for multiple command line arguments.
Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
When system is going down, systemd kills all the users processes,
including 'xl' daemons waiting for domain shutdown. This results in
zombie domains not cleaned up. The proper fix would be somehow extract
those processes from user session scope (most likely by starting them as
a service).
But because it applies only to system shutdown (qvm-shutdown
call there), it is simpler to add appropriate handling code to
qvm-shutdown.
In R3 the problem will vanish, because of use libvirtd deamon, so no
user processes required to track domains state.