On Thu, Sep 26, 2024 at 04:15:37PM +0200, Lucas Nussbaum wrote:
Hi,

On 26/09/24 at 14:31 +0200, Francesco P. Lovergine wrote:

Hi,

did you consider to patch for Virtualbox 7.1 support? It should be
quite immediate, I don't see any specific problem in the provider,
I could provide a patch agains 3.7 series just in case...

A patch would be great.
For now Virtualbox 7.1 is not in unstable yet.

Lucas


Here it is.

--
Francesco P. Lovergine | https://lovergine.com/
diff --git a/plugins/providers/virtualbox/driver/meta.rb b/plugins/providers/virtualbox/driver/meta.rb
index 04c130c44..251f79ca5 100644
--- a/plugins/providers/virtualbox/driver/meta.rb
+++ b/plugins/providers/virtualbox/driver/meta.rb
@@ -66,6 +66,7 @@ module VagrantPlugins
             "6.0" => Version_6_0,
             "6.1" => Version_6_1,
             "7.0" => Version_7_0,
+            "7.1" => Version_7_1,
           }
 
           if @@version.start_with?("4.2.14")
diff --git a/plugins/providers/virtualbox/driver/version_7_1.rb b/plugins/providers/virtualbox/driver/version_7_1.rb
new file mode 100644
index 000000000..563c55918
--- /dev/null
+++ b/plugins/providers/virtualbox/driver/version_7_1.rb
@@ -0,0 +1,24 @@
+require File.expand_path("../version_7_0", __FILE__)
+
+module VagrantPlugins
+  module ProviderVirtualBox
+    module Driver
+      # Driver for VirtualBox 7.1.x
+      class Version_7_1 < Version_7_0
+        def initialize(uuid)
+          super
+
+          @logger = Log4r::Logger.new("vagrant::provider::virtualbox_7_0")
+        end
+
+        # VirtualBox version in use
+        #
+        # @return [Gem::Version]
+        def get_version
+          return @version if @version
+          @version = Gem::Version.new(Meta.new.version)
+        end
+      end
+    end
+  end
+end
diff --git a/plugins/providers/virtualbox/plugin.rb b/plugins/providers/virtualbox/plugin.rb
index 3b447c5c2..96d20a156 100644
--- a/plugins/providers/virtualbox/plugin.rb
+++ b/plugins/providers/virtualbox/plugin.rb
@@ -101,6 +101,7 @@ module VagrantPlugins
       autoload :Version_6_0, File.expand_path("../driver/version_6_0", __FILE__)
       autoload :Version_6_1, File.expand_path("../driver/version_6_1", __FILE__)
       autoload :Version_7_0, File.expand_path("../driver/version_7_0", __FILE__)
+      autoload :Version_7_1, File.expand_path("../driver/version_7_1", __FILE__)
     end
 
     module Model

Reply via email to