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 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. # If not, we dump the storage pool xml to get its defined path.
# the default storage prefix is typically: /var/lib/libvirt/images/ # the default storage prefix is typically: /var/lib/libvirt/images/
if env[:machine].config.vm.box if !config.qemu_use_session
storage_prefix = File.dirname(@domain_volume_path) + '/' # steal if env[:machine].config.vm.box
else storage_prefix = File.dirname(@domain_volume_path) + '/' # steal
storage_pool = env[:machine].provider.driver.connection.client.lookup_storage_pool_by_name(@storage_pool_name) else
raise Errors::NoStoragePool if storage_pool.nil? storage_pool = env[:machine].provider.driver.connection.client.lookup_storage_pool_by_name(@storage_pool_name)
xml = Nokogiri::XML(storage_pool.xml_desc) raise Errors::NoStoragePool if storage_pool.nil?
storage_prefix = xml.xpath('/pool/target/path').inner_text.to_s + '/' xml = Nokogiri::XML(storage_pool.xml_desc)
storage_prefix = xml.xpath('/pool/target/path').inner_text.to_s + '/'
end
end end
@disks.each do |disk| @disks.each do |disk|

View File

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