From: Michael Tremer Date: Sun, 26 Dec 2010 15:00:30 +0000 (+0100) Subject: Add check for Qemu hypervisor that identifies as "Bochs". X-Git-Tag: v0.13~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2bc7d30faf8f97a167ffdda9f4f867182e83bf9;p=oddments%2Ffireinfo.git Add check for Qemu hypervisor that identifies as "Bochs". --- diff --git a/fireinfo/hypervisor.py b/fireinfo/hypervisor.py index 83f2a85..5a075f7 100644 --- a/fireinfo/hypervisor.py +++ b/fireinfo/hypervisor.py @@ -44,6 +44,10 @@ class Hypervisor(object): elif self.__is_hypervisor_virtualbox(): return "VirtualBox" + # Check for qemu. + elif self.__is_hypervisor_qemu(): + return "Qemu" + return "unknown" @property @@ -66,7 +70,8 @@ class Hypervisor(object): return _fireinfo.is_virtualized() or \ "hypervisor" in self.system.cpu.flags or \ self.__is_hypervisor_virtualbox() or \ - self.__is_hypervisor_vmware() + self.__is_hypervisor_vmware() or \ + self.__is_hypervisor_qemu() def __is_hypervisor_virtualbox(self): """ @@ -84,6 +89,12 @@ class Hypervisor(object): return self.system.bios_vendor.startswith("VMWare-") and \ _fireinfo.vmware_hypervisor_port_check() + def __is_hypervisor_qemu(self): + """ + Check for old qemu emulator. + """ + return self.system.bios_vendor == "Bochs" + if __name__ == "__main__": h = Hypervisor()