[DRE-commits] [vagrant-libvirt] 50/77: Verify libvirt version before enabling 9p

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:56:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.17
in repository vagrant-libvirt.

commit 32a3abe412be0233ad8016e82198504b88b8d7f9
Author: Brian Pitts <brian at polibyte.com>
Date:   Sat May 3 18:11:26 2014 -0500

    Verify libvirt version before enabling 9p
---
 lib/vagrant-libvirt/cap/synced_folder.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/vagrant-libvirt/cap/synced_folder.rb b/lib/vagrant-libvirt/cap/synced_folder.rb
index 0bc285e..f80869f 100644
--- a/lib/vagrant-libvirt/cap/synced_folder.rb
+++ b/lib/vagrant-libvirt/cap/synced_folder.rb
@@ -21,9 +21,17 @@ module VagrantPlugins
       end
 
       def usable?(machine, raise_error=false)
-        # TODO check for host support (eg in linux is 9p compiled ?)
-        # and support in Qemu for instance ?
-        machine.provider_name == :libvirt
+        # bail now if not using libvirt since checking version would throw error
+        return false unless machine.provider_name == :libvirt
+
+        # <filesystem/> support in device attach/detach introduced in 1.2.2
+        # version number format is major * 1,000,000 + minor * 1,000 + release
+        libvirt_version = ProviderLibvirt.libvirt_connection.client.libversion
+        if libvirt_version >= 1002002
+          return true
+        else
+          return false
+        end
       end
 
       def prepare(machine, folders, opts)

-- 
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