Merge pull request #721 from galkindmitrii/master

virtual sound card support
This commit is contained in:
Dmitry Vasilets 2017-01-12 20:04:36 +01:00 committed by GitHub
commit 2fe3ede420
5 changed files with 18 additions and 0 deletions

View File

@ -332,6 +332,8 @@ end
"cirrus", "vmvga", "xen", "vbox", or "qxl".
* `video_vram` - Used by some graphics card types to vary the amount of RAM
dedicated to video. Defaults to 9216.
* `sound_type` - [Set the virtual sound card](https://libvirt.org/formatdomain.html#elementsSound)
Defaults to "ich6".
* `machine_type` - Sets machine type. Equivalent to qemu `-machine`. Use
`qemu-system-x86_64 -machine help` to get a list of supported machines.
* `machine_arch` - Sets machine architecture. This helps libvirt to determine

View File

@ -61,6 +61,7 @@ module VagrantPlugins
"passwd='#{config.graphics_passwd}'"
end
@video_type = config.video_type
@sound_type = config.sound_type
@video_vram = config.video_vram
@keymap = config.keymap
@kvm_hidden = config.kvm_hidden
@ -192,6 +193,7 @@ module VagrantPlugins
env[:ui].info(" -- Graphics Password: #{@graphics_passwd.empty? ? 'Not defined' : 'Defined'}")
env[:ui].info(" -- Video Type: #{@video_type}")
env[:ui].info(" -- Video VRAM: #{@video_vram}")
env[:ui].info(" -- Sound Type: #{@sound_type}")
env[:ui].info(" -- Keymap: #{@keymap}")
env[:ui].info(" -- TPM Path: #{@tpm_path}")

View File

@ -221,6 +221,12 @@ module VagrantPlugins
end
end
# Sound device
if config.sound_type
sound = REXML::XPath.first(xml_descr,'/domain/devices/sound/model')
end
# dtb
if config.dtb
dtb = REXML::XPath.first(xml_descr, '/domain/os/dtb')

View File

@ -184,6 +184,7 @@ module VagrantPlugins
@graphics_passwd = UNSET_VALUE
@video_type = UNSET_VALUE
@video_vram = UNSET_VALUE
@sound_type = UNSET_VALUE
@keymap = UNSET_VALUE
@kvm_hidden = UNSET_VALUE
@ -585,6 +586,7 @@ module VagrantPlugins
@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
@sound_type = nil if @sound_type == UNSET_VALUE
@keymap = 'en-us' if @keymap == UNSET_VALUE
@kvm_hidden = false if @kvm_hidden == UNSET_VALUE
@tpm_model = 'tpm-tis' if @tpm_model == UNSET_VALUE

View File

@ -132,6 +132,12 @@
<input type='<%= input[:type] %>' bus='<%= input[:bus] %>'/>
<% end %>
<% if !@sound_type.nil? %>
<%# Sound device-%>
<sound model='<%= @sound_type %>'>
</sound>
<%# End Sound%>
<% end %>
<% if @graphics_type != 'none' %>
<%# Video device -%>
<graphics type='<%= @graphics_type %>' port='<%= @graphics_port %>' autoport='<%= @graphics_autoport %>' listen='<%= @graphics_ip %>' keymap='<%= @keymap %>' <%= @graphics_passwd%> />