puppetlabs/facter — pull request #774 by Freeaqingme (2014-08-29 14:10:13+00:00)
Title: Detect KVM even when generic CPU Model Name is used.

We recently changed our VPS's CPU models from "QEMU Virtual CPU version 1.7.1"
to "Westmere E56xx/L56xx/X56xx (Nehalem-C)". This led to facter
errorenously detecting a physical environment rather than a virtualized one.

This commit checks both pciconf and dmidecode for any signs of a virtualized.
environment. KVM relies on bochs for emulating its BIOS. But if there's no
virtio device and no telling CPU Model Name there is no way to distinct
between plain Bochs and Bochs used together with KVM (at least not that I'm
aware of). Therefore, I added an extra virtual type called 'bochs'. At least
it will result either way in is_virtual=true.