[DRE-commits] [vagrant-libvirt] 41/163: templatized handling of graphics and video libvirt XML

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:57:02 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 a926607615af742beef54c76dc0d2a81258efd83
Author: Wolfgang Richter <wolf at cs.cmu.edu>
Date:   Sun Sep 28 01:44:39 2014 -0400

    templatized handling of graphics and video libvirt XML
---
 lib/vagrant-libvirt/action/create_domain.rb  | 11 +++++++++++
 lib/vagrant-libvirt/config.rb                | 15 +++++++++++++++
 lib/vagrant-libvirt/templates/domain.xml.erb |  4 ++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb
index ad46ff0..42a0ef5 100644
--- a/lib/vagrant-libvirt/action/create_domain.rb
+++ b/lib/vagrant-libvirt/action/create_domain.rb
@@ -35,6 +35,11 @@ module VagrantPlugins
           @kernel = config.kernel
           @cmd_line = config.cmd_line
           @initrd = config.initrd
+          @graphics_type = config.graphics_type
+          @graphics_port = config.graphics_port
+          @graphics_ip = config.graphics_ip
+          @video_type = config.video_type
+          @video_vram = config.video_vram
 
           # Storage
           @storage_pool_name = config.storage_pool_name
@@ -89,6 +94,12 @@ module VagrantPlugins
           env[:ui].info(" -- Volume Cache:  #{@domain_volume_cache}")
           env[:ui].info(" -- Kernel:        #{@kernel}")
           env[:ui].info(" -- Initrd:        #{@initrd}")
+          env[:ui].info(" -- Graphics Type: #{@graphics_type}")
+          env[:ui].info(" -- Graphics Port: #{@graphics_port}")
+          env[:ui].info(" -- Graphics IP:   #{@graphics_ip}")
+          env[:ui].info(" -- Video Type:    #{@video_type}")
+          env[:ui].info(" -- Video VRAM:    #{@video_vram}")
+
           if @disks.length > 0
             env[:ui].info(" -- Disks:         #{_disks_print(@disks)}")
           end
diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb
index 7e8e402..97ce60b 100644
--- a/lib/vagrant-libvirt/config.rb
+++ b/lib/vagrant-libvirt/config.rb
@@ -61,6 +61,11 @@ module VagrantPlugins
       attr_accessor :kernel
       attr_accessor :cmd_line
       attr_accessor :initrd
+      attr_accessor :graphics_type
+      attr_accessor :graphics_port
+      attr_accessor :graphics_ip
+      attr_accessor :video_type
+      attr_accessor :video_vram
 
       # Storage
       attr_accessor :disks
@@ -89,6 +94,11 @@ module VagrantPlugins
         @kernel            = UNSET_VALUE
         @initrd            = UNSET_VALUE
         @cmd_line          = UNSET_VALUE
+        @graphics_type     = UNSET_VALUE
+        @graphics_port     = UNSET_VALUE
+        @graphics_ip       = UNSET_VALUE
+        @video_type        = UNSET_VALUE
+        @video_vram        = UNSET_VALUE
 
         # Storage
         @disks             = UNSET_VALUE
@@ -206,6 +216,11 @@ module VagrantPlugins
         @kernel = nil if @kernel == UNSET_VALUE
         @cmd_line = '' if @cmd_line == UNSET_VALUE
         @initrd = '' if @initrd == UNSET_VALUE
+        @graphics_type = 'vnc' if @graphics_type == UNSET_VALUE
+        @graphics_port = 5900 if @graphics_port == UNSET_VALUE
+        @graphics_ip = '127.0.0.1' if @graphics_ip == UNSET_VALUE
+        @video_type = 'cirrus' if @video_type == UNSET_VALUE
+        @video_vram = 9216 if @video_vram == UNSET_VALUE
 
         # Storage
         @disks = [] if @disks == UNSET_VALUE
diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb
index ea35da6..f8fdc2e 100644
--- a/lib/vagrant-libvirt/templates/domain.xml.erb
+++ b/lib/vagrant-libvirt/templates/domain.xml.erb
@@ -49,9 +49,9 @@
       <target port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
+    <graphics type='<%= @graphics_type %>' port='<%= @graphics_port %>' autoport='no' listen='<%= @graphics_ip %>' keymap='en-us'/>
     <video>
-      <model type='cirrus' vram='9216' heads='1'/>
+        <model type='<%= @video_type %>' vram='<%= @video_vram %>' heads='1'/>
     </video>
   </devices>
 </domain>

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