Is there a architecture and machine type independent way to detect that
one is running inside a KVM guest? I've noticed the following systemd
code which does this detection and it seems to be very architecture
dependent for KVM:
https://github.com/systemd/systemd/blob/master/src/shared/virt.c

In addition one could grep for strings in the kernel log or CPU types if
using QEMU CPU model.

Given the many ways to do this, would it make sense to create a sysfs
entry (similar to how Xen does this with /sys/hypervisor/type), so that
one can easily tell they are running in a KVM guest?

I can work on a patch, but initial feedback would be helpful.

Thanks,
--chris j arges
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to