Skip to content

Commit

Permalink
Merge pull request #24824 from kev009/grains-bhyve-bsd
Browse files Browse the repository at this point in the history
Detect bhyve virtual type for FreeBSD guests
  • Loading branch information
thatch45 committed Jun 22, 2015
2 parents 7b07ef9 + a226209 commit 9e3321c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions salt/grains/core.py
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 9e3321c

Please sign in to comment.