From c65cfb5adcaef7906a4c09ae3d90c975091a3745 Mon Sep 17 00:00:00 2001 From: Alberto Ortega Date: Sat, 29 Aug 2015 00:29:41 +0200 Subject: [PATCH] Add new qemu detection based on CPU brand string --- pafish/qemu.c | 7 +++++++ pafish/qemu.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/pafish/qemu.c b/pafish/qemu.c index 9367612..ec96efc 100644 --- a/pafish/qemu.c +++ b/pafish/qemu.c @@ -5,6 +5,7 @@ #include "qemu.h" #include "types.h" #include "utils.h" +#include "cpu.h" int qemu_reg_key1() { return pafish_exists_regkey_value_str(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port 0\\Scsi Bus 0\\Target Id 0\\Logical Unit Id 0", "Identifier", "QEMU"); @@ -14,3 +15,9 @@ int qemu_reg_key2() { return pafish_exists_regkey_value_str(HKEY_LOCAL_MACHINE, "HARDWARE\\Description\\System", "SystemBiosVersion", "QEMU"); } +int qemu_cpu_name() { + char cpu_brand[49]; + cpu_write_brand(cpu_brand); + return !memcmp(cpu_brand, "QEMU Virtual CPU", 16) ? TRUE : FALSE; +} + diff --git a/pafish/qemu.h b/pafish/qemu.h index 53ee250..4b24e33 100644 --- a/pafish/qemu.h +++ b/pafish/qemu.h @@ -6,4 +6,6 @@ int qemu_reg_key1(); int qemu_reg_key2(); +int qemu_cpu_name(); + #endif