]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Add support for Microsoft Hyper-V and Virtual PC.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 18 Jan 2011 18:52:28 +0000 (19:52 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 18 Jan 2011 18:52:28 +0000 (19:52 +0100)
fireinfo/hypervisor.py

index 76cd3a2f7fc1a232c986ec7dec5e09d966db8579..9286bd48ab863f92775dac26d400926bd0701886 100644 (file)
@@ -67,6 +67,10 @@ class Hypervisor(object):
                        elif self.__is_hypervisor_qemu():
                                return "Qemu"
 
+                       # Check for Microsoft.
+                       elif self.__is_hypervisor_microsoft():
+                               return "Microsoft"
+
                return "unknown"
 
        @property
@@ -96,7 +100,8 @@ class Hypervisor(object):
                        "hypervisor" in self.system.cpu.flags or \
                        self.__is_hypervisor_virtualbox() or \
                        self.__is_hypervisor_vmware() or \
-                       self.__is_hypervisor_qemu()
+                       self.__is_hypervisor_qemu() or \
+                       self.__is_hypervisor_microsoft()
 
        def __is_hypervisor_virtualbox(self):
                """
@@ -123,6 +128,12 @@ class Hypervisor(object):
                """
                return self.system.bios_vendor == "Bochs"
 
+       def __is_hypervisor_microsoft(self):
+               """
+                       Check for Microsoft hypervisor.
+               """
+               return "Microsoft" in self.system.vendor
+
 
 if __name__ == "__main__":
        h = Hypervisor()