/usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/templates/domain.xml.erb is in vagrant-libvirt 0.0.43-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | <domain type='<%= @domain_type %>' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name><%= @name %></name>
<uuid><%= @uuid %></uuid>
<memory><%= @memory_size %></memory>
<vcpu><%= @cpus %></vcpu>
<cpu mode='<%= @cpu_mode %>'>
<% if @cpu_mode != 'host-passthrough' %>
<model fallback='<%= @cpu_fallback %>'><% if @cpu_mode == 'custom' %><%= @cpu_model %><% end %></model>
<% if @nested %>
<feature policy='optional' name='vmx'/>
<feature policy='optional' name='svm'/>
<% end %>
<% @cpu_features.each do |cpu_feature| %>
<feature name='<%= cpu_feature[:name] %>' policy='<%= cpu_feature[:policy] %>'/>
<% end %>
<% unless @cpu_topology.empty? %>
<%# CPU topology -%>
<topology sockets='<%= @cpu_topology[:sockets] %>' cores='<%= @cpu_topology[:cores] %>' threads='<%= @cpu_topology[:threads] %>'/>
<% end %>
<% end %>
<% if @numa_nodes %>
<numa>
<% @numa_nodes.each_with_index do |node, index| %>
<cell id='<%= index %>' cpus='<%= node[:cpus] %>' memory='<%= node[:memory] %>'/>
<% end %>
</numa>
<% end %>
</cpu>
<% unless @memory_backing.empty? %>
<memoryBacking>
<% @memory_backing.each do |backing| %>
<<%= backing[:name] %> <%= backing[:config].map { |k,v| "#{k}='#{v}'"}.join(' ') %>/>
<% end %>
</memoryBacking>
<% end%>
<os>
<% if @machine_type %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>' machine='<%= @machine_type %>'>hvm</type>
<% else %>
<type machine='<%= @machine_type %>'>hvm</type>
<% end %>
<% else %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>'>hvm</type>
<% else %>
<type>hvm</type>
<% end %>
<% end %>
<% if @loader %>
<loader readonly='yes' type='rom'><%= @loader %></loader>
<% end %>
<% if @boot_order.count >= 1 %>
<bootmenu enable='yes'/>
<% end %>
<kernel><%= @kernel %></kernel>
<initrd><%= @initrd %></initrd>
<cmdline><%= @cmd_line %></cmdline>
<% if @dtb %>
<dtb><%= @dtb %></dtb>
<% end %>
</os>
<features>
<% @features.each do |feature| %>
<<%= feature %>/>
<% end %>
<% if @kvm_hidden %>
<kvm>
<hidden state='on'/>
</kvm>
<% end %>
</features>
<clock offset='utc'/>
<devices>
<% if @emulator_path %>
<emulator><%= @emulator_path %></emulator>
<% end %>
<% if @domain_volume_path %>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>
<source file='<%= @domain_volume_path %>'/>
<%# we need to ensure a unique target dev -%>
<target dev='<%= @disk_device %>' bus='<%= @disk_bus %>'/>
</disk>
<% end %>
<%# additional disks -%>
<% @disks.each do |d| -%>
<disk type='file' device='disk'>
<driver name='qemu' type='<%= d[:type] %>' cache='<%= d[:cache] %>'/>
<source file='<%= d[:absolute_path] %>'/>
<target dev='<%= d[:device] %>' bus='<%= d[:bus] %>'/>
<% if d[:shareable] %>
<shareable/>
<% end %>
<% if d[:serial] %>
<serial><%= d[:serial] %></serial>
<% end %>
<%# this will get auto generated by libvirt
<address type='pci' domain='0x0000' bus='0x00' slot='???' function='0x0'/>
-%>
</disk>
<% end -%>
<% @cdroms.each do |c| %>
<disk type='file' device='cdrom'>
<source file='<%= c[:path] %>'/>
<target dev='<%= c[:dev] %>' bus='<%= c[:bus] %>'/>
<readonly/>
</disk>
<% end %>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<% @channels.each do |channel| %>
<channel type='<%= channel[:type] %>' >
<%if channel[:source_mode] or channel[:source_path] %>
<source
<% if channel[:source_mode] %>
mode='<%= channel[:source_mode] %>'
<% end %>
<% if channel[:source_path] %>
path="<%= channel[:source_path] %>"
<% end %>
/>
<% end %>
<target type='<%= channel[:target_type] %>'
<% if channel[:target_name] %>
name="<%= channel[:target_name] %>"
<% end %>
<% if channel[:target_address] %>
address="<%= channel[:target_address] %>"
<% end %>
<% if channel[:target_port] %>
port="<%= channel[:target_port] %>"
<% end %>
/>
</channel>
<% end %>
<% @inputs.each do |input| %>
<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%> />
<video>
<model type='<%= @video_type %>' vram='<%= @video_vram %>' heads='1'/>
</video>
<%#End Video -%>
<% end %>
<% if @rng[:model] == "random"%>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
</rng>
<% end %>
<% @pcis.each do |pci| %>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000'
bus='<%= pci[:bus] %>'
slot='<%= pci[:slot] %>'
function='<%= pci[:function] %>'/>
</source>
</hostdev>
<% end %>
<% @usbs.each do |usb| %>
<hostdev mode='subsystem' type='usb'>
<source startupPolicy='<%= usb[:startupPolicy] || "mandatory" %>'>
<% if usb[:vendor] %>
<vendor id='<%= usb[:vendor] %>'/>
<% end %>
<% if usb[:product] %>
<product id='<%= usb[:product] %>'/>
<% end %>
<% if usb[:bus] && usb[:device] %>
<address bus='<%= usb[:bus] %>' device='<%= usb[:device] %>'/>
<% end %>
</source>
</hostdev>
<% end %>
<% unless @redirdevs.empty? %>
<% @redirdevs.each do |redirdev| %>
<redirdev bus='usb' type='<%= redirdev[:type] %>'>
</redirdev>
<% end %>
<% unless @redirfilters.empty? %>
<redirfilter>
<% @redirfilters.each do |usbdev| %>
<usbdev class='<%= usbdev[:class] %>' vendor='<%= usbdev[:vendor] %>' product='<%= usbdev[:product] %>' version='<%= usbdev[:version] %>' allow='<%= usbdev[:allow] %>'/>
<% end %>
</redirfilter>
<% end %>
<% end %>
<% unless @watchdog_dev.empty? %>
<%# Watchdog Device -%>
<watchdog model='<%= @watchdog_dev[:model] %>' action='<%= @watchdog_dev[:action] %>'/>
<% end %>
<% unless @smartcard_dev.empty? -%>
<% if @smartcard_dev[:mode] == 'passthrough' %>
<% if @smartcard_dev[:type] == 'tcp' %>
<smartcard mode='<%= @smartcard_dev[:mode] %>' type='<%= @smartcard_dev[:type] %>'>
<source mode='<%= @smartcard_dev[:source_mode] %>' host='<%= @smartcard_dev[:source_host] %>' service='<%= @smartcard_dev[:source_service] %>'/>
</smartcard>
<% else %>
<smartcard mode='<%= @smartcard_dev[:mode] %>' type='<%= @smartcard_dev[:type] %>'/>
<% end %>
<% end %>
<% end -%>
<% if @tpm_path -%>
<%# TPM Device -%>
<tpm model='<%= @tpm_model %>'>
<backend type='<%= @tpm_type %>'>
<device path='<%= @tpm_path %>'/>
</backend>
</tpm>
<% end -%>
</devices>
<% unless @qargs.empty? %>
<qemu:commandline>
<% @qargs.each do |arg| %>
<qemu:arg value='<%= arg[:value] %>'/>
<% end %>
</qemu:commandline>
<% end %>
</domain>
|