From: Alex Williamson <alex.williamson@hp.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: "dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Shell test for pv vs hvm (vs dom0)
Date: Mon, 25 Feb 2008 05:58:28 -0700 [thread overview]
Message-ID: <1203944308.7125.5.camel@lappy> (raw)
In-Reply-To: <C3E58772.14462%Keir.Fraser@cl.cam.ac.uk>
On Sat, 2008-02-23 at 08:18 +0000, Keir Fraser wrote:
> There's no general way to discriminate between HVM and native from a shell
> script. You might discriminate between HVM and PV on Linux by looking for
> /sys/hypervisor or /proc/xen.
Isn't something like this generally sufficient for a shell script?
lspci -n | grep -q "5853:0001"
if [ $? -eq 0 ]; then
# HVM domain
elif [ -d /proc/xen ]; then
if grep -q "control_d" /proc/xen/capabilities; then
# DOM0
else
# DOMU
fi
else
# Native
fi
It seems fairly reliable on ia64 for Xen 3.x. Thanks,
Alex
--
Alex Williamson HP Open Source & Linux Org.
next prev parent reply other threads:[~2008-02-25 12:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 20:58 Shell test for pv vs hvm (vs dom0) Dan Magenheimer
2008-02-22 21:18 ` Keir Fraser
2008-02-22 22:38 ` Dan Magenheimer
2008-02-23 5:36 ` pradeep singh rautela
2008-02-23 8:18 ` Keir Fraser
2008-02-23 14:26 ` Stephan Seitz
2008-02-23 14:35 ` Keir Fraser
2008-02-23 16:48 ` Dan Magenheimer
2008-02-25 12:58 ` Alex Williamson [this message]
2008-02-25 13:40 ` Keir Fraser
2008-02-25 13:45 ` Daniel P. Berrange
2008-02-25 15:38 ` Dan Magenheimer
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=1203944308.7125.5.camel@lappy \
--to=alex.williamson@hp.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=dan.magenheimer@oracle.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.