block.xml 713 B

123456789101112131415161718192021
  1. <disk type="block" device="{{ options.get('devtype', 'disk') }}">
  2. <driver name="phy" />
  3. <source dev="{{ device.device_node }}" />
  4. {%- if 'frontend-dev' in options %}
  5. <target dev="{{ options.get('frontend-dev') }}" />
  6. {%- elif options.get('devtype', 'disk') == 'cdrom' and not vm.kernel %}
  7. <!-- prefer xvdd for CDROM -->
  8. <target dev="xvdd" />
  9. {%- else %}
  10. <target dev="xvd{{dd[i]}}" />
  11. {% set i = i + 1 %}
  12. {%- endif %}
  13. {%- if options.get('read-only', 'no') == 'yes' %}
  14. <readonly />
  15. {%- endif %}
  16. {%- if device.backend_domain.name != 'dom0' %}
  17. <backenddomain name="{{ device.backend_domain.name }}" />
  18. {%- endif %}
  19. </disk>