<domain type='kvm'>
<name><%= name %></name>
<% if uuid %>
<uuid><%= uuid %></uuid>
<% end %>
<memory unit='KiB'><%= memory %></memory>
<currentMemory unit='KiB'><%= memory%></currentMemory>
<vcpu placement='static'><%= cpus %></vcpu>
  <os>
  <type arch='<%= arch %>' machine='pc-1.2'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator><%= qemu_bin %></emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='<%= image_type %>'/>
      <source file='<%= disk %>'/>
      <target dev='vda' bus='<%= disk_bus %>'/>
<% if disk_bus == 'virtio' %>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
<% else %>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
<% end %>
    </disk>
    <interface type='network'>
      <mac address='<%= mac %>'/>
      <source network='vagrant'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <% if gui %>
    <%= "<graphics type='vnc' port='-1' autoport='yes'/>" %>
    <% end %>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>
