Class: Facts::Linux::Hypervisors::Xen

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/facts/linux/hypervisors/xen.rb

Constant Summary collapse

FACT_NAME =
'hypervisors.xen'

Instance Method Summary collapse

Constructor Details

#initializeXen

Returns a new instance of Xen.



9
10
11
# File 'lib/facter/facts/linux/hypervisors/xen.rb', line 9

def initialize
  @log = Facter::Log.new(self)
end

Instance Method Details

#call_the_resolverObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/facter/facts/linux/hypervisors/xen.rb', line 13

def call_the_resolver
  if xen?
    @log.debug('Xen hypervisor detected')
    fact_value = {}

    fact_value[:context] = hvm? ? 'hvm' : 'pv'
    fact_value[:privileged] = Facter::Resolvers::Xen.resolve(:privileged)

    return Facter::ResolvedFact.new(FACT_NAME, fact_value)
  end

  @log.debug('No Xen hypervisor detected.')
  []
end