From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: Re: How to detect if a machine is a Virtual machine ?? Date: Wed, 23 Dec 2009 10:30:40 +0100 Message-ID: <4B31E340.4040902@redhat.com> References: <0a0cdd47-ffb6-4911-b704-c427360b2c62@default> <4B30A167.8070802@redhat.com> <4B31DFE5.1010408@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B31DFE5.1010408@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 12/23/2009 10:16 AM, John Haxby wrote: > On 22/12/09 10:37, Michal Novotny wrote: >> Hi Sachin, >> the tool is not in the virtual machine. This is the tool that's in >> dom0. Since there is a source code for this one you could scp it to >> the guest, compile and run inside the guest environment. There is no >> need to provide a guest with this tool by default and in fact this is >> really impossible so it's better to scp it to the guest and compile >> there. > > It's also worth pointing out that the underlying test for xen in this > program executes a particular instruction to find the information > about its environment. What that means is that it's possible to > write a version of ./tools/misc/xen-detect.c that will work in any > guest machine OS. > I am not saying this does not work in any guest machine but just that the tools is provided in dom0 only and installed to guest machines by default. In fact it's trapping some instruction and according to my testing it's OK to scp it to the guest and XEN_PV return value will be set for PV guest or XEN_FV (or something similar) for fully virtualized environment... Michal