diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb index f146c55..8077b67 100644 --- a/lib/vagrant-libvirt/action/create_domain.rb +++ b/lib/vagrant-libvirt/action/create_domain.rb @@ -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| diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 6c97e55..73d6e5d 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -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)