[DRE-commits] [vagrant-libvirt] 84/163: Do not chance disk path
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:57:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.26
in repository vagrant-libvirt.
commit a5b5e3e800fcc1b633a651509c85a91555575232
Author: Brian Pitts <brian at polibyte.com>
Date: Mon Nov 17 22:47:32 2014 -0600
Do not chance disk path
Mutating path caused vagrant to constatnyl spew errors from #validate
while waiting for ssh to be available. Instead, create a new key.
---
lib/vagrant-libvirt/action/create_domain.rb | 9 +++------
lib/vagrant-libvirt/templates/domain.xml.erb | 2 +-
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb
index a49e4fe..094fe96 100644
--- a/lib/vagrant-libvirt/action/create_domain.rb
+++ b/lib/vagrant-libvirt/action/create_domain.rb
@@ -75,10 +75,7 @@ module VagrantPlugins
# http://www.redhat.com/archives/libvir-list/2008-August/msg00329.html
disk[:name] = disk[:path]
- # Prefix relative paths by storage pool path
- unless disk[:path][0] == '/'
- disk[:path] = storage_prefix + disk[:path]
- end
+ disk[:absolute_path] = storage_prefix + disk[:path]
# make the disk. equivalent to:
# qemu-img create -f qcow2 <path> 5g
@@ -86,7 +83,7 @@ module VagrantPlugins
domain_volume_disk = env[:libvirt_compute].volumes.create(
:name => disk[:name],
:format_type => disk[:type],
- :path => disk[:path],
+ :path => disk[:absolute_path],
:capacity => disk[:size],
#:allocation => ?,
:pool_name => @storage_pool_name)
@@ -119,7 +116,7 @@ module VagrantPlugins
env[:ui].info(" -- Disks: #{_disks_print(@disks)}")
end
@disks.each do |disk|
- env[:ui].info(" -- Disk(#{disk[:device]}): #{disk[:path]}")
+ env[:ui].info(" -- Disk(#{disk[:device]}): #{disk[:absolute_path]}")
end
env[:ui].info(" -- Command line : #{@cmd_line}")
diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb
index 1db5894..7351448 100644
--- a/lib/vagrant-libvirt/templates/domain.xml.erb
+++ b/lib/vagrant-libvirt/templates/domain.xml.erb
@@ -37,7 +37,7 @@
<% @disks.each do |d| -%>
<disk type='file' device='disk'>
<driver name='qemu' type='<%= d[:type] %>' cache='<%= d[:cache] %>'/>
- <source file='<%= d[:path] %>'/>
+ <source file='<%= d[:absolute_path] %>'/>
<target dev='<%= d[:device] %>' bus='<%= d[:bus] %>'/>
<%# this will get auto generated by libvirt
<address type='pci' domain='0x0000' bus='0x00' slot='???' function='0x0'/>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git
More information about the Pkg-ruby-extras-commits
mailing list