Navigation Menu

Skip to content

Commit

Permalink
Add new qemu detection based on CPU brand string
Browse files Browse the repository at this point in the history
  • Loading branch information
a0rtega committed Aug 28, 2015
1 parent 94dca54 commit c65cfb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pafish/qemu.c
Expand Up @@ -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");
Expand All @@ -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;
}

2 changes: 2 additions & 0 deletions pafish/qemu.h
Expand Up @@ -6,4 +6,6 @@ int qemu_reg_key1();

int qemu_reg_key2();

int qemu_cpu_name();

#endif

0 comments on commit c65cfb5

Please sign in to comment.