fix for qemuargs which broke standart behaviour

This commit is contained in:
dima
2017-04-29 15:08:26 +02:00
parent b222da780d
commit 5696ac8da6
3 changed files with 10 additions and 17 deletions

View File

@@ -102,9 +102,6 @@ module VagrantPlugins
# smartcard device
@smartcard_dev = config.smartcard_dev
# qemuargs
@qemuargs = config.qemuargs
# RNG device passthrough
@rng = config.rng
@@ -283,15 +280,16 @@ module VagrantPlugins
env[:ui].info(" -- smartcard device: mode=#{@smartcard_dev[:mode]}, type=#{@smartcard_dev[:type]}")
end
unless @qemuargs.empty?
@qargs = config.qemu_args
if not @qargs.empty?
env[:ui].info(' -- Command line args: ')
@qemuargs.each do |arg|
@qargs.each do |arg|
msg = " -> value=#{arg[:value]}, "
env[:ui].info(msg)
end
end
env[:ui].info(" -- Command line : #{@cmd_line}")
env[:ui].info(" -- Command line : #{@cmd_line}") unless @cmd_line.empty?
# Create libvirt domain.
# Is there a way to tell fog to create new domain with already

View File

@@ -142,7 +142,7 @@ module VagrantPlugins
attr_accessor :mgmt_attach
# Additional qemuargs arguments
attr_accessor :qemuargs
attr_accessor :qemu_args
def initialize
@uri = UNSET_VALUE
@@ -242,7 +242,7 @@ module VagrantPlugins
# Attach mgmt network
@mgmt_attach = UNSET_VALUE
@qemuargs = UNSET_VALUE
@qemu_args = []
end
def boot(device)
@@ -495,8 +495,7 @@ module VagrantPlugins
end
def qemuargs(options = {})
@qemuargs = [] if @qemuargs == UNSET_VALUE
@qemuargs.push(value: options[:value])
@qemu_args << options if options[:value]
end
# code to generate URI from a config moved out of the connect action
@@ -662,7 +661,7 @@ module VagrantPlugins
# Attach mgmt network
@mgmt_attach = true if @mgmt_attach == UNSET_VALUE
@qemuargs = [] if @qemuargs == UNSET_VALUE
@qemu_args = [] if @qemu_args == UNSET_VALUE
end
def validate(machine)
@@ -692,10 +691,6 @@ module VagrantPlugins
c = cdroms.dup
c += other.cdroms
result.cdroms = c
c = qemuargs.dup
c += other.qemuargs
result.qemuargs = c
end
end
end

View File

@@ -219,9 +219,9 @@
<% end -%>
</devices>
<% unless @qemuargs.empty? %>
<% unless @qargs.empty? %>
<qemu:commandline>
<% @qemuargs.each do |arg| %>
<% @qargs.each do |arg| %>
<qemu:arg value='<%= arg[:value] %>'/>
<% end %>
</qemu:commandline>