lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] VMware guest detection for x86 and x86-64
Yan Li wrote:
> Detects whether we are running as a VMware guest or not. Detection is
> based upon DMI vendor string.
>
> It provides a function:
> int is_vmware_guest(void)
> that can be used easily to detect if we are running as a VMware guest
> or not.
>
> I haven't used PCI vendor Id since that requires copying a trunk of
> codes from early_quirks() and I think copying code is not good. And
> reusing codes from early_quirks() needs intrivial change to present
> codes structure. Comparatively, checking "VMware" string against DMI
> manufacturer is a lot more simpler (one-line code). Also there's no
> evidence indicating that VMware will change their vendor string in
> near future. Therefore I choose to use simpler way.
>
> Tested on x86 and x86-64 VMs and machines.

I'd like to make this a general VM platform detection subsystem. We
have similar issues with Virtual PC, and again, DMI appears to be the
sanest way to detect it -- at least to a primary screen.

-hpa


\
 
 \ /
  Last update: 2008-09-24 18:23    [W:0.173 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site