All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrew D. Ball" <aball@linux.vnet.ibm.com>
To: Akio Takebe <takebe_akio@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com, Ewan Mellor <ewan@xensource.com>
Subject: Re: [RFC] Is this process running on which machine?
Date: Mon, 20 Nov 2006 22:03:17 -0500	[thread overview]
Message-ID: <1164078197.24087.56.camel@localhost> (raw)
In-Reply-To: <D5C70C553A5E85takebe_akio@jp.fujitsu.com>

You can use dmidecode on HVM domU's running Linux.  This reads the
SMBIOS tables.  The system information type (type 1) will tell you that
it's an HVM domU.

Peace.
Andrew

On Mon, 2006-11-20 at 12:37 +0900, Akio Takebe wrote:
> Hi, Ewan and all
> 
> Using /proc/xen is not good
> because unmodified driver create /proc/xen on HVM.
> Which is better?
>     A. chech existing /proc/xen/capabilities
>     B. check existing /sys/hypervisor?
> 
> I feel A is better.
> But will xen support privcmd as unmodified driver in the future?
> How do you think about it?
> 
> Best Regards,
> 
> Akio Takebe
> 
> >Hi, Ewan and all
> >
> >Thank you for your comments.
> >I remake my scripts.
> >
> >I tested on dom0,domU,HVM(x86),native.
> >Are there any other comments or suggestions?
> >
> >=================================================================
> >#!/bin/bash
> >
> >if [ -d /proc/xen ] ; then
> >        if $(grep -q control_d /proc/xen/capabilities); then
> >                echo "this is dom0."
> >        else
> >                echo "this is domU."
> >        fi
> >else
> >        IS_X86HVM="$(strings /proc/acpi/dsdt | grep int-xen)"
> >        if [ x"${IS_X86HVM}" != x ]; then
> >                echo "this is x86 hvm machine"
> >        else
> >                echo "this is native machine"
> >        fi
> >fi
> >=================================================================
> >
> >Best Regards,
> >
> >Akio Takebe
> >
> >>On Sat, Nov 18, 2006 at 06:10:57PM +0900, Akio Takebe wrote:
> >>
> >>> Hi, all
> >>>
> >>> I'd like to know "Is this process running on which machine?"
> >>> For example, a native machien, or dom0, or domU, or HVM..
> >>>
> >>> So I research codes of xen,
> >>> then I make the following shell.
> >>> (I haven't confirmed HVM yet because I don't use VTx machine.)
> >>> What do you think about it?
> >>>
> >>> =========================================================================
> >>> #!/bin/bash
> >>>
> >>> if [ -d /sys/hypervisor ] ; then
> >>>         UUID=$(cat /sys/hypervisor/uuid)
> >>>         if [ x"$UUID" == x"00000000-0000-0000-0000-000000000000" ]; then
> >>>                 echo "this is dom0."
> >>>         else
> >>>                 echo "this is domU."
> >>>         fi
> >>> else
> >>>         IS_HVM=$(strings /proc/acpi/dsdt | grep -i xen)
> >>>         if [ x"IS_HVM" != x ]; then
> >>>                 echo "this is hvm machine"
> >>>         else
> >>>                 echo "this is native machine"
> >>>         fi
> >>> fi
> >>
> >>I wouldn't rely upon the UUID of domain 0 being all-zeros -- there have
> >>been arguments about that in the past.
> >>
> >>The proper mechanism for doing this is
> >>
> >>grep -q "control_d" /proc/xen/capabilities
> >>
> >>This will be true if you are in the "initial control domain"
> >>(SIF_INITDOMAIN has been set).
> >>
> >>Ewan.
> >>
> >>_______________________________________________
> >>Xen-devel mailing list
> >>Xen-devel@lists.xensource.com
> >>http://lists.xensource.com/xen-devel
> >
> >
> >_______________________________________________
> >Xen-devel mailing list
> >Xen-devel@lists.xensource.com
> >http://lists.xensource.com/xen-devel
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2006-11-21  3:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-18  9:10 [RFC] Is this process running on which machine? Akio Takebe
2006-11-18 13:53 ` Ewan Mellor
2006-11-20  1:57   ` Akio Takebe
2006-11-20  3:37     ` Akio Takebe
2006-11-21  3:03       ` Andrew D. Ball [this message]
2006-11-21  8:52         ` Akio Takebe
2006-11-27  4:39           ` Akio Takebe
2006-11-28  4:00             ` Akio Takebe

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=1164078197.24087.56.camel@localhost \
    --to=aball@linux.vnet.ibm.com \
    --cc=ewan@xensource.com \
    --cc=takebe_akio@jp.fujitsu.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.