Skip to content

Commit

Permalink
Detect bhyve virtual type for freebsd guests
Browse files Browse the repository at this point in the history
  • Loading branch information
kev009 committed Jun 19, 2015
1 parent ae05e70 commit a226209
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,13 @@ def _virtual(osdata):
if maker.startswith('OpenStack'):
grains['virtual'] = 'OpenStack'
if sysctl:
hv_vendor = __salt__['cmd.run']('{0} hw.hv_vendor'.format(sysctl))
model = __salt__['cmd.run']('{0} hw.model'.format(sysctl))
jail = __salt__['cmd.run'](
'{0} -n security.jail.jailed'.format(sysctl)
)
if 'bhyve' in hv_vendor:
grains['virtual'] = 'bhyve'
if jail == '1':
grains['virtual_subtype'] = 'jail'
if 'QEMU Virtual CPU' in model:
Expand Down

0 comments on commit a226209

Please sign in to comment.