From 52226508689504d9ecb4b250a1b580c3003bc64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 19 Feb 2019 15:25:05 +0100 Subject: [PATCH] vm/adminvm: add stubs for kill/shutdown functions Report proper error message, instead of throwing AttributeError on such calls. Fixes QubesOS/qubes-issues#4645 --- qubes/vm/adminvm.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qubes/vm/adminvm.py b/qubes/vm/adminvm.py index e83f0ab9..e2c7a260 100644 --- a/qubes/vm/adminvm.py +++ b/qubes/vm/adminvm.py @@ -178,6 +178,22 @@ class AdminVM(qubes.vm.BaseVM): ''' raise qubes.exc.QubesVMError(self, 'Cannot suspend Dom0 fake domain!') + def shutdown(self): + '''Does nothing. + + .. seealso: + :py:meth:`qubes.vm.qubesvm.QubesVM.shutdown` + ''' + raise qubes.exc.QubesVMError(self, 'Cannot shutdown Dom0 fake domain!') + + def kill(self): + '''Does nothing. + + .. seealso: + :py:meth:`qubes.vm.qubesvm.QubesVM.kill` + ''' + raise qubes.exc.QubesVMError(self, 'Cannot kill Dom0 fake domain!') + @property def icon_path(self): pass