[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Shell test for pv vs hvm (vs dom0)



Yes, that should work for Linux just fine I think.

 -- Keir

On 25/2/08 12:58, "Alex Williamson" <alex.williamson@xxxxxx> 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.