Module: VagrantPlugins::ProviderLibvirt::Util::StorageUtil

Included in:
Action::CreateDomain, Action::CreateDomainVolume, Action::HandleBoxImage, Action::HandleStoragePool
Defined in:
lib/vagrant-libvirt/util/storage_util.rb

Instance Method Summary collapse

Instance Method Details

#storage_gid(env) ⇒ Object



11
12
13
# File 'lib/vagrant-libvirt/util/storage_util.rb', line 11

def storage_gid(env)
  env[:machine].provider_config.qemu_use_session ? Process.gid : 0
end

#storage_pool_path(env) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-libvirt/util/storage_util.rb', line 15

def storage_pool_path(env)
  if env[:machine].provider_config.storage_pool_path
    env[:machine].provider_config.storage_pool_path
  elsif env[:machine].provider_config.qemu_use_session
    File.expand_path('~/.local/share/libvirt/images')
  else
    '/var/lib/libvirt/images'
  end
end

#storage_uid(env) ⇒ Object



7
8
9
# File 'lib/vagrant-libvirt/util/storage_util.rb', line 7

def storage_uid(env)
  env[:machine].provider_config.qemu_use_session ? Process.uid : 0
end