KVM Guest Detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux