All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.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>,
	Alex Williamson <alex.williamson@hp.com>
Subject: Re: Shell test for pv vs hvm (vs dom0)
Date: Mon, 25 Feb 2008 13:45:31 +0000	[thread overview]
Message-ID: <20080225134531.GE2614@redhat.com> (raw)
In-Reply-To: <C3E875B5.1CE19%Keir.Fraser@cl.cam.ac.uk>

On Mon, Feb 25, 2008 at 01:40:05PM +0000, Keir Fraser wrote:
> Yes, that should work for Linux just fine I think.

On x86 at least you also have the option of using  dmidecode to detect an
HVM guest, looking for 'Xen' in the 'System Information' block.

And the 'xen-detect' command in tools/misc/ provides another way to
detect presence of Xen PV vs HVM.

> On 25/2/08 12:58, "Alex Williamson" <alex.williamson@hp.com> wrote:
> 
> > 
> > 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
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

  reply	other threads:[~2008-02-25 13:45 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
2008-02-25 13:40         ` Keir Fraser
2008-02-25 13:45           ` Daniel P. Berrange [this message]
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=20080225134531.GE2614@redhat.com \
    --to=berrange@redhat.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=alex.williamson@hp.com \
    --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.