wags007/salt — comment on commit a773cd9fdef3265b9ced6a8103a75fd924451289
File: salt/grains/core.py line 163
By SEJeff:

https://github.com/puppetlabs/facter/blob/master/lib/facter/util/virtual.rb#L65 # Facter can't do it
http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=4f381ab4c38cd9d38861a0fbfe764d2c5d5c59b4;hb=HEAD#l214 # Uses virt-what-cpuid-helper and hence this small bit of asm:

asm volatile (
"xor %%ebx, %%ebx; cpuid"
: "=a" (eax), "=b" (sig32[0]), "=c" (sig32[1]), "=d" (sig32[2])
: "0" (eax));
sig[12] = 0;

(on snowy.gnome.org, a KVM guest I setup for https://edge.tomboy-online.org):
[root@snowy ~]# dmidecode -s system-product-name
KVM
[root@snowy ~]# dmidecode -s system-manufacturer
Red Hat

However much older kvm reported these both as Bochs. Our best bet for now is to use virt-what if it exists or dmidecode if it exists otherwise, the best you can do is detect Qemu. I'll send in some patches for this.