[DRE-commits] [vagrant-libvirt] 46/67: Add kernel/initrd/cmd_line directives for the qemu driver

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


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

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

commit 5f0d365c82d7910f8c155e68d371568d37f77af3
Author: Matt <mattator at gmail.com>
Date:   Tue Jan 7 13:45:57 2014 +0100

    Add kernel/initrd/cmd_line directives for the qemu driver
---
 lib/vagrant-libvirt/action/create_domain.rb  | 6 ++++++
 lib/vagrant-libvirt/config.rb                | 9 +++++++++
 lib/vagrant-libvirt/templates/domain.xml.erb | 3 +++
 3 files changed, 18 insertions(+)

diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb
index 21d1707..113c6ca 100644
--- a/lib/vagrant-libvirt/action/create_domain.rb
+++ b/lib/vagrant-libvirt/action/create_domain.rb
@@ -24,6 +24,9 @@ module VagrantPlugins
           @nested = config.nested
           @memory_size = config.memory*1024
           @domain_volume_cache = config.volume_cache
+          @kernel = config.kernel
+          @cmd_line = config.cmd_line
+          @initrd = config.initrd
 
           # TODO get type from driver config option
           @domain_type = 'kvm'
@@ -46,6 +49,9 @@ module VagrantPlugins
           env[:ui].info(" -- Storage pool:  #{env[:machine].provider_config.storage_pool_name}")
           env[:ui].info(" -- Image:         #{@domain_volume_path}")
           env[:ui].info(" -- Volume Cache:  #{@domain_volume_cache}")
+          env[:ui].info(" -- Kernel:        #{@kernel}")
+          env[:ui].info(" -- Initrd:        #{@initrd}")
+          env[:ui].info(" -- Command line : #{@cmd_line}")
 
           # Create libvirt domain.
           # Is there a way to tell fog to create new domain with already
diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb
index bd5bbc2..9a63515 100644
--- a/lib/vagrant-libvirt/config.rb
+++ b/lib/vagrant-libvirt/config.rb
@@ -35,6 +35,9 @@ module VagrantPlugins
       attr_accessor :disk_bus
       attr_accessor :nested
       attr_accessor :volume_cache
+      attr_accessor :kernel
+      attr_accessor :cmd_line
+      attr_accessor :initrd
 
       def initialize
         @driver            = UNSET_VALUE
@@ -53,6 +56,9 @@ module VagrantPlugins
         @disk_bus          = UNSET_VALUE
         @nested            = UNSET_VALUE
         @volume_cache      = UNSET_VALUE
+        @kernel            = UNSET_VALUE
+        @initrd            = UNSET_VALUE
+        @cmd_line          = UNSET_VALUE
       end
 
       def finalize!
@@ -72,6 +78,9 @@ module VagrantPlugins
         @disk_bus = 'virtio' if @disk_bus == UNSET_VALUE
         @nested = false if @nested == UNSET_VALUE
         @volume_cache = 'default' if @volume_cache == UNSET_VALUE
+        @kernel = nil if @kernel == UNSET_VALUE
+        @cmd_line = '' if @cmd_line == UNSET_VALUE
+        @initrd = '' if @initrd == UNSET_VALUE
       end
 
       def validate(machine)
diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb
index 8b943e1..3837303 100644
--- a/lib/vagrant-libvirt/templates/domain.xml.erb
+++ b/lib/vagrant-libvirt/templates/domain.xml.erb
@@ -14,6 +14,9 @@
   <os>
     <type arch='x86_64'>hvm</type>
     <boot dev='hd'/>
+    <kernel><%= @kernel %></kernel>
+    <initrd><%= @initrd %></initrd>
+    <cmdline><%= @cmd_line %></cmdline>
   </os>
   <features>
     <acpi/>

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