bug fixes for qemu_use_session

This commit is contained in:
dima 2018-03-17 14:26:13 +01:00
parent 29ce8443b1
commit 99371fee2b
2 changed files with 12 additions and 9 deletions

View File

@ -129,13 +129,15 @@ module VagrantPlugins
# If we have a box, take the path from the domain volume and set our storage_prefix.
# If not, we dump the storage pool xml to get its defined path.
# the default storage prefix is typically: /var/lib/libvirt/images/
if env[:machine].config.vm.box
storage_prefix = File.dirname(@domain_volume_path) + '/' # steal
else
storage_pool = env[:machine].provider.driver.connection.client.lookup_storage_pool_by_name(@storage_pool_name)
raise Errors::NoStoragePool if storage_pool.nil?
xml = Nokogiri::XML(storage_pool.xml_desc)
storage_prefix = xml.xpath('/pool/target/path').inner_text.to_s + '/'
if !config.qemu_use_session
if env[:machine].config.vm.box
storage_prefix = File.dirname(@domain_volume_path) + '/' # steal
else
storage_pool = env[:machine].provider.driver.connection.client.lookup_storage_pool_by_name(@storage_pool_name)
raise Errors::NoStoragePool if storage_pool.nil?
xml = Nokogiri::XML(storage_pool.xml_desc)
storage_prefix = xml.xpath('/pool/target/path').inner_text.to_s + '/'
end
end
@disks.each do |disk|

View File

@ -347,7 +347,7 @@ module VagrantPlugins
@cpu_topology[:sockets] = options[:sockets]
@cpu_topology[:cores] = options[:cores]
@cpu_topology[:threads] = options[:threads]
@cpu_topology[:threads] = options[:threads]
end
def memorybacking(option, config = {})
@ -622,6 +622,8 @@ module VagrantPlugins
@management_network_pci_slot = nil if @management_network_pci_slot == UNSET_VALUE
@system_uri = 'qemu:///system' if @system_uri == UNSET_VALUE
@qemu_use_session = false if @qemu_use_session == UNSET_VALUE
# generate a URI if none is supplied
@uri = _generate_uri if @uri == UNSET_VALUE
@ -727,7 +729,6 @@ module VagrantPlugins
@mgmt_attach = true if @mgmt_attach == UNSET_VALUE
@qemu_args = [] if @qemu_args == UNSET_VALUE
@qemu_use_session = false if @qemu_use_session == UNSET_VALUE
end
def validate(machine)