manager/qubesmanager
M. Vefa Bicakci d551bdc3fa
Do not abort VM restarts due to inconsistent info
Prior to this commit, there have been occasional issues with the usage
of the Qubes Manager's VM restart button where the restart procedure
is interrupted due to an exception thrown after the VM in question is
shut down. The exception has the following backtrace:

  ----
  line: assert not vm.is_running()
  func: start_vm
  line no.: 1198
  file: /usr/lib64/python2.7/site-packages/qubesmanager/main.py
  ----
  line: self.caller.start_vm(vm)
  func: check_if_vm_has_shutdown
  line no.: 308
  file: /usr/lib64/python2.7/site-packages/qubesmanager/main.py

Upon investigation, the root cause of the issue appears to be
inconsistent information provided by Xen regarding a recently-shut-down
VM's start-up timestamp and its state (i.e., running or shut down).

In some cases Xen would report that the VM is running whereas the
start-up timestamp would be returned as None, due to unknown reasons.
This inconsistency would then cause the code modified by this commit to
call the Qubes Manager's "start_vm" method, which would attempt to
assert that a VM is shut down, which would raise the aforementioned
exception.

This commit aims to resolve this issue by checking whether the VM has
fully shut down according to Xen and by calling "start_vm" only if the
VM has fully shut down.

This commit also slightly refactors the affected code.

Fixes: QubesOS/qubes-issues#2438
2017-05-13 14:30:37 -04:00
..
__init__.py Initial public commit. 2010-05-11 16:54:35 +02:00
.gitignore gitignore 2012-07-05 00:47:05 +02:00
about.py Move network diagram to System menu in Manager 2017-01-28 03:15:58 +00:00
appmenu_select.py *.py: Use full paths when calling subprocess.Popen(). 2014-05-22 15:07:35 +02:00
backup_utils.py i18n: wrap strings with self.tr 2017-01-22 13:22:26 +01:00
backup.py Add more missing unicode()s around .tr()s 2017-02-19 21:49:03 -05:00
block.py fix TypeError 2016-07-07 18:16:16 +02:00
clipboard.py Re-write to avoid leaking fd if flock(2) fails 2016-11-26 21:00:01 -05:00
create_new_vm.py i18n: wrap self.tf in unicode() where 'format' function is used 2017-02-06 04:20:13 +01:00
firewall.py i18n: wrap strings with self.tr 2017-01-22 13:22:26 +01:00
global_settings.py i18n: wrap strings with self.tr 2017-01-22 13:22:26 +01:00
informationnotes.py Add extended information and Network diagram to Manager 2017-01-26 20:36:39 +00:00
log_dialog.py Add more missing unicode()s around .tr()s 2017-02-19 21:49:03 -05:00
main.py Do not abort VM restarts due to inconsistent info 2017-05-13 14:30:37 -04:00
mount_for_backup.sh Remove trailing semicolons 2014-02-23 00:44:08 +01:00
multiselectwidget.py Remove trailing semicolons 2014-02-23 00:44:08 +01:00
networknotes.py Move network diagram to System menu in Manager 2017-01-28 03:15:58 +00:00
qvm_about.sh Add extended information and Network diagram to Manager 2017-01-26 20:36:39 +00:00
qvm_net.py Add extended information and Network diagram to Manager 2017-01-26 20:36:39 +00:00
releasenotes.py Create custom 'About' dialog, with 'release notes' viewer (#1259) 2015-10-01 22:34:49 +02:00
restore.py Add more missing unicode()s around .tr()s 2017-02-19 21:49:03 -05:00
settings.py settings: save qubes.xml after saving firewall rules 2017-04-24 01:59:00 +02:00
table_widgets.py Progress bar can match light or dark palette 2017-03-21 10:57:32 -04:00
thread_monitor.py use any python2, not explicit python2.6 2013-01-23 15:55:14 +01:00