git.annexia.org
/
virt-what.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01ea13d
)
helper: Fix KVM signature.
author
Richard W.M. Jones
<rjones@redhat.com>
Fri, 4 Oct 2019 17:30:01 +0000
(18:30 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 10 Dec 2019 12:49:28 +0000
(12:49 +0000)
Thanks: Paolo Bonzini.
virt-what-cpuid-helper.c
patch
|
blob
|
history
diff --git
a/virt-what-cpuid-helper.c
b/virt-what-cpuid-helper.c
index
0cd4a6f
..
9c6cdb2
100644
(file)
--- a/
virt-what-cpuid-helper.c
+++ b/
virt-what-cpuid-helper.c
@@
-28,15
+28,16
@@
#if defined(__i386__) || defined(__x86_64__)
/* Known x86 hypervisor signatures. Note that if you add a new test
#if defined(__i386__) || defined(__x86_64__)
/* Known x86 hypervisor signatures. Note that if you add a new test
- * to virt-what.in you may need to update this list. The signature is
- * always 12 bytes except in the case of KVM.
+ * to virt-what.in you may need to update this list. Note the
+ * signature is always 12 bytes long, plus we add \0 to the end to
+ * make it 13 bytes.
*/
static int
*/
static int
-known_signature (char *sig)
+known_signature (c
onst c
har *sig)
{
return
strcmp (sig, "bhyve bhyve ") == 0 ||
{
return
strcmp (sig, "bhyve bhyve ") == 0 ||
-
strcmp (sig, "KVMKVMKVM"
) == 0 ||
+
memcmp (sig, "KVMKVMKVM\0\0\0", 12
) == 0 ||
strcmp (sig, "LKVMLKVMLKVM") == 0 ||
strcmp (sig, "Microsoft Hv") == 0 ||
strcmp (sig, "OpenBSDVMM58") == 0 ||
strcmp (sig, "LKVMLKVMLKVM") == 0 ||
strcmp (sig, "Microsoft Hv") == 0 ||
strcmp (sig, "OpenBSDVMM58") == 0 ||