All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Is this process running on which machine?
@ 2006-11-18  9:10 Akio Takebe
  2006-11-18 13:53 ` Ewan Mellor
  0 siblings, 1 reply; 8+ messages in thread
From: Akio Takebe @ 2006-11-18  9:10 UTC (permalink / raw)
  To: xen-devel

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
=========================================================================

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-28  4:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-11-21  8:52         ` Akio Takebe
2006-11-27  4:39           ` Akio Takebe
2006-11-28  4:00             ` Akio Takebe

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.