]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: enable detecting QEMU (TCG) via CPUID (#6399)
authorDaniel Berrange <berrange@redhat.com>
Wed, 19 Jul 2017 09:06:07 +0000 (10:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Jul 2017 09:06:07 +0000 (11:06 +0200)
QEMU >= 2.10 will include a CPUID leaf with value "TCGTCGTCGTCG"
on x86 when running with the TCG CPU emulator:

  https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg05231.html

Existing methods of detecting QEMU are left unchanged for sake of
backcompatibility.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/basic/virt.c

index 60117445238f395b8015dcb73b0ac5a17933d1ed..5143ac6656664b23d8651b2559626c67a2a1a9bc 100644 (file)
@@ -46,6 +46,7 @@ static int detect_vm_cpuid(void) {
         } cpuid_vendor_table[] = {
                 { "XenVMMXenVMM", VIRTUALIZATION_XEN       },
                 { "KVMKVMKVM",    VIRTUALIZATION_KVM       },
+                { "TCGTCGTCGTCG", VIRTUALIZATION_QEMU      },
                 /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
                 { "VMwareVMware", VIRTUALIZATION_VMWARE    },
                 /* https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs */