Browse Source

vm: add vm.klass property

Allow to get domain class as a property, not using admin.vm.List call.
This makes it unnecessary to call admin.vm.List on the client side to
construct wrapper object.
Marek Marczykowski-Górecki 6 years ago
parent
commit
a90dea34de
1 changed files with 4 additions and 0 deletions
  1. 4 0
      qubes/vm/__init__.py

+ 4 - 0
qubes/vm/__init__.py

@@ -500,6 +500,10 @@ class BaseVM(qubes.PropertyHolder):
         for path in self._qdb_watch_paths:
             self._qdb_connection_watch.watch(path)
 
+    @qubes.stateless_property
+    def klass(self):
+        '''Domain class name'''
+        return type(self).__name__
 
 class VMProperty(qubes.property):
     '''Property that is referring to a VM