Browse Source

vm/adminvm: add stubs for kill/shutdown functions

Report proper error message, instead of throwing AttributeError on such
calls.

Fixes QubesOS/qubes-issues#4645
Marek Marczykowski-Górecki 5 years ago
parent
commit
5222650868
1 changed files with 16 additions and 0 deletions
  1. 16 0
      qubes/vm/adminvm.py

+ 16 - 0
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