From 8df13baade3867aeaae9eca24e5947f631745726 Mon Sep 17 00:00:00 2001 From: Brian Pitts Date: Sun, 7 Dec 2014 14:25:54 -0600 Subject: [PATCH] Change libvirt method for creating storage pool We should use define_storage pool_xml instead of create_storage_pool_xml so that * the pool is permanent * pool creation succeeds if the directory does not already exist --- lib/vagrant-libvirt/action/handle_storage_pool.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-libvirt/action/handle_storage_pool.rb b/lib/vagrant-libvirt/action/handle_storage_pool.rb index 9ebae53..e405638 100644 --- a/lib/vagrant-libvirt/action/handle_storage_pool.rb +++ b/lib/vagrant-libvirt/action/handle_storage_pool.rb @@ -34,8 +34,10 @@ module VagrantPlugins # Fog libvirt currently doesn't support creating pools. Use # ruby-libvirt client directly. begin - libvirt_pool = env[:libvirt_compute].client.create_storage_pool_xml( + libvirt_pool = env[:libvirt_compute].client.define_storage_pool_xml( to_xml('default_storage_pool')) + libvirt_pool.build + libvirt_pool.create rescue => e raise Errors::CreatingStoragePoolError, :error_message => e.message