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

Included in:
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


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

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

#storage_pool_path(env) ⇒ Object


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

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


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

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