Commit Graph

9 Commits

Author SHA1 Message Date
M. Vefa Bicakci
6bcc97b859
qvm-shutdown: Do not mutate list while iterating through it
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>
2017-03-16 12:11:55 +01:00
M. Vefa Bicakci
e499e6e88c
qvm-shutdown: Allow multiple VMs to be shut down with one invocation
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>
2017-03-16 12:10:58 +01:00
M. Vefa Bicakci
1d9d59a335
qvm-shutdown: Add missing documentation for multi-VM support 2017-03-16 12:10:37 +01:00
Marek Marczykowski-Górecki
adb282ef8e
Implement qvm-shutdown --wait-time option
Flexible VM shutdown timeout option.

Fixes QubesOS/qubes-issues#1320
2015-12-26 02:14:28 +01:00
Marek Marczykowski-Górecki
68460fb272 qvm-tools/qvm-shutdown: handle domains with xl daemon killed (#903)
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.
2014-09-26 02:18:42 +02:00
Marek Marczykowski-Górecki
fc7d686b2e qvm-tools/qvm-shutdown: do not kill already dead VM
When VM stop just when the timeout expires, qvm-shutdown should not try
to kill it - this would result in QubesException("VM already stopped!").
2014-09-25 05:47:35 +02:00
Marek Marczykowski-Górecki
44f38fe076 Declare file encoding for all python files, fill missing copyright headers
Without that, python do not accept UTF-8 even in comments.
2014-05-18 21:03:27 +02:00
Marek Marczykowski-Górecki
60d373dbda qvm-tools: grammar fix in help message
might be repeated -> may be repeated
2014-01-23 04:50:14 +01:00
Marek Marczykowski
a84886db07 Move all files one level up 2013-03-16 19:56:51 +01:00