From: Chris J Arges <chris.j.arges@canonical.com>
To: kvm@vger.kernel.org
Subject: KVM Guest Detection
Date: Fri, 06 Feb 2015 14:08:09 -0600 [thread overview]
Message-ID: <54D51F29.2000305@canonical.com> (raw)
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
next reply other threads:[~2015-02-06 20:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 20:08 Chris J Arges [this message]
2015-02-09 13:26 ` KVM Guest Detection Paolo Bonzini
2015-02-09 14:37 ` Chris J Arges
2015-02-09 16:12 ` Paolo Bonzini
-- strict thread matches above, loose matches on Subject: below --
2008-08-13 17:57 KVM Guest detection jd
2008-08-13 18:40 ` David Mair
2008-08-13 18:59 ` Anthony Liguori
2008-08-13 21:05 ` jd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D51F29.2000305@canonical.com \
--to=chris.j.arges@canonical.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).