Introduce VM_GUEST_QEMU. As VM_GUEST_BHYVE, VM_GUEST_PARALLELS and
VM_GUEST_NVMM, it has no specific code associated with it, but is
declared just so that "qemu" can be reported by sysctl 'kern.vm_guest'.
Add prefix match, and change matching of Parallels in
'smbios.system.product' to be prefix-based, as the current exact name:
- Does not match Parallels running on Apple silicon (arm64).
- Probably does not match Parallels running on amd64 either, as the string seem more similar to what is contained in 'smbios.planar.product' ("Virtual Platform", and not "Virtual Machine), which we don't use.
According to an analysis of its code, the only trustable indication of
QEMU running is "QEMU" in 'smbios.system.maker', as other strings may be
overriden by machine descriptions. However, since QEMU enables
overriding any of the SMBIOS strings, we keep the match on
'smbios.system.product' to increase chances of detection, and change it
as a prefix match given QEMU may also insert machine details between
"QEMU" and "Virtual Machine".
Matches of the loader-filled SMBIOS strings are now performed as follows:
- 'smbios.system.maker' (System's Manufacturer, Type 1)
- 'smbios.system.product' (System's Product Name, Type 1)
- 'smbios.bios.vendor' (Platform Firmware's Vendor Name, Type 0)
Before this change, 1 was not matched, and 2 and 3 were swapped as we
believe that case 2 has more chances to be discriminating than case 3.
Actually, a "continue" mechanism would allow proceeding to case 2 if
case 3 only determined VM_GUEST_VM (i.e., running in some unspecified
VM) in the hope that case 2 would refine it. It has been removed given
the swap.